#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
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();
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)
thePrs->setWidth(17);
// 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();
+
+ /// \brief Initializes attributes of derived class.
+ virtual void initDerivedClassAttributes(){};
+
};
#endif