X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_SketchEntity.h;h=20f1e46f732205e98545e914308135dc613ef898;hb=a8d47776cf43a5535c262115d529e2f9f445cef3;hp=b56992b893ccb06b8e398e3c0f64da326096e8fe;hpb=42985955d89fa845790a7e38609f5b6838285147;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_SketchEntity.h b/src/SketchPlugin/SketchPlugin_SketchEntity.h index b56992b89..20f1e46f7 100644 --- 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_OVERCONSTRAINT_COLOR "0,0,0" /**\class SketchPlugin_SketchEntity * \ingroup Plugins @@ -46,6 +47,13 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC 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(); @@ -58,6 +66,16 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC 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 theDefaultPrs) @@ -104,12 +122,20 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC 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