X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_SketchEntity.h;h=cffdee549483e335a54c19f171fbaa17ef9a1717;hb=853e0eec6016120b641efa6adf427a239cf203cf;hp=b1b74b519c9d9824dcc1b37009784a17070139a2;hpb=694482299ca580d780c221cc6a3e7574e59fd2c3;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_SketchEntity.h b/src/SketchPlugin/SketchPlugin_SketchEntity.h index b1b74b519..cffdee549 100644 --- a/src/SketchPlugin/SketchPlugin_SketchEntity.h +++ b/src/SketchPlugin/SketchPlugin_SketchEntity.h @@ -20,10 +20,9 @@ #include -#define SKETCH_EDGE_COLOR "#ff0000" -#define SKETCH_POINT_COLOR "#ff0000" -#define SKETCH_EXTERNAL_EDGE_COLOR "#00ff00" -#define SKETCH_CONSTRUCTION_COLOR "#000000" +#define SKETCH_ENTITY_COLOR "225,0,0" +#define SKETCH_EXTERNAL_COLOR "170,0,225" +#define SKETCH_AUXILIARY_COLOR "0,85,0" /**\class SketchPlugin_SketchEntity * \ingroup Plugins @@ -34,10 +33,10 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC { public: /// Reference to the construction type of the feature - inline static const std::string& CONSTRUCTION_ID() + inline static const std::string& AUXILIARY_ID() { - static const std::string MY_CONSTRUCTION_ID("Construction"); - return MY_CONSTRUCTION_ID; + static const std::string MY_AUXILIARY_ID("Auxiliary"); + return MY_AUXILIARY_ID; } /// Reference to the external edge or vertex as a AttributeSelection @@ -69,43 +68,39 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC if (aShapeType != 6/*an edge*/ && aShapeType != 7/*a vertex*/ && aShapeType != 0/*compound*/) return false; + // set color from preferences std::vector aColor; - std::shared_ptr aConstructionAttr = - data()->boolean(SketchPlugin_SketchEntity::CONSTRUCTION_ID()); - bool isConstruction = aConstructionAttr.get() != NULL && aConstructionAttr->value(); + std::shared_ptr anAuxiliaryAttr = + data()->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID()); + bool isConstruction = anAuxiliaryAttr.get() != NULL && anAuxiliaryAttr->value(); + if (isConstruction) { + aColor = Config_PropManager::color("Visualization", "sketch_auxiliary_color", + SKETCH_AUXILIARY_COLOR); + } + else if (isExternal()) { + aColor = Config_PropManager::color("Visualization", "sketch_external_color", + SKETCH_EXTERNAL_COLOR); + } + else { + aColor = Config_PropManager::color("Visualization", "sketch_entity_color", + SKETCH_ENTITY_COLOR); + } + if (!aColor.empty()) + isCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]) || isCustomized; + if (aShapeType == 6 || aShapeType == 0) { // if this is an edge or a compound if (isConstruction) { isCustomized = thePrs->setWidth(1) || isCustomized; isCustomized = thePrs->setLineStyle(3) || isCustomized; - - aColor = Config_PropManager::color("Visualization", "sketch_construction_color", - SKETCH_CONSTRUCTION_COLOR); } else { isCustomized = thePrs->setWidth(3) || isCustomized; isCustomized = thePrs->setLineStyle(0) || isCustomized; - - if (isExternal()) { - // Set color from preferences - aColor = Config_PropManager::color("Visualization", "sketch_external_color", - SKETCH_EXTERNAL_EDGE_COLOR); - } - else { - // Set color from preferences - aColor = Config_PropManager::color("Visualization", "sketch_edge_color", - SKETCH_EDGE_COLOR); - } } } - else if (aShapeType == 7) { // otherwise this is a vertex - // thePrs->setPointMarker(6, 2.); - aColor = Config_PropManager::color("Visualization", "sketch_point_color", - SKETCH_POINT_COLOR); - } - - if (!aColor.empty()) { - isCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]) || isCustomized; - } + //else if (aShapeType == 7) { // otherwise this is a vertex + // thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol + //} return isCustomized; }