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 a26ef9aa4d227147f22305412f32d33f381d00c3..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
3
);
+ 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