Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
registerNotObligatory is not necessary if this property is set in XML.
[modules/shaper.git]
/
src
/
SketchPlugin
/
SketchPlugin_SketchEntity.h
diff --git
a/src/SketchPlugin/SketchPlugin_SketchEntity.h
b/src/SketchPlugin/SketchPlugin_SketchEntity.h
index 152d680a6c5fea721bbb6eb8fa7d9c6e7d431831..20f1e46f732205e98545e914308135dc613ef898 100644
(file)
--- a/
src/SketchPlugin/SketchPlugin_SketchEntity.h
+++ b/
src/SketchPlugin/SketchPlugin_SketchEntity.h
@@
-23,6
+23,7
@@
#define SKETCH_ENTITY_COLOR "225,0,0"
#define SKETCH_EXTERNAL_COLOR "170,0,225"
#define SKETCH_AUXILIARY_COLOR "0,85,0"
#define SKETCH_ENTITY_COLOR "225,0,0"
#define SKETCH_EXTERNAL_COLOR "170,0,225"
#define SKETCH_AUXILIARY_COLOR "0,85,0"
+#define SKETCH_OVERCONSTRAINT_COLOR "0,0,0"
/**\class SketchPlugin_SketchEntity
* \ingroup Plugins
/**\class SketchPlugin_SketchEntity
* \ingroup Plugins
@@
-46,6
+47,13
@@
class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC
return MY_EXTERNAL_ID;
}
return MY_EXTERNAL_ID;
}
+ /// Reference to the copy type of the feature
+ inline static const std::string& COPY_ID()
+ {
+ static const std::string MY_COPY_ID("Copy");
+ return MY_COPY_ID;
+ }
+
/// Request for initialization of data model of the feature: adding all attributes
virtual void initAttributes();
/// Request for initialization of data model of the feature: adding all attributes
virtual void initAttributes();
@@
-58,6
+66,16
@@
class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC
return false;
}
return false;
}
+ /// Returns true of the feature is a copy of other feature
+ virtual bool isCopy() const
+ {
+ AttributeBooleanPtr anAttr = data()->boolean(COPY_ID());
+ if(anAttr.get()) {
+ return anAttr->value();
+ }
+ return false;
+ }
+
/// Customize presentation of the feature
virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
/// Customize presentation of the feature
virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
@@
-101,15
+119,23
@@
class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC
else if (aShapeType == 7) { // otherwise this is a vertex
// The width value do not have effect on the point presentation.
// It is defined in order to extend selection area of the object.
else if (aShapeType == 7) { // otherwise this is a vertex
// The width value do not have effect on the point presentation.
// It is defined in order to extend selection area of the object.
- thePrs->setWidth(1
2
);
+ thePrs->setWidth(1
7
);
// thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol
}
// thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol
}
+ if(isCopy()) {
+ double aWidth = thePrs->width();
+ isCustomized = thePrs->setWidth(aWidth / 2.5) || isCustomized;
+ }
return isCustomized;
}
protected:
/// initializes mySketch
SketchPlugin_SketchEntity();
return isCustomized;
}
protected:
/// initializes mySketch
SketchPlugin_SketchEntity();
+
+ /// \brief Initializes attributes of derived class.
+ virtual void initDerivedClassAttributes(){};
+
};
#endif
};
#endif