X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_ConstraintLength.cpp;h=949908b293f628672969fdd7e52a85d5b3204d34;hb=4ab46ebbcaca8341a41859a16b57d0ac80ea986c;hp=575c0f10a9f9a620ee01a97802eea42e44dcccff;hpb=318397f164871a2de94a33a5802a3e4fe8981756;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp index 575c0f10a..949908b29 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp @@ -40,6 +40,14 @@ void SketchPlugin_ConstraintLength::initAttributes() data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId()); } +void SketchPlugin_ConstraintLength::colorConfigInfo(std::string& theSection, std::string& theName, + std::string& theDefault) +{ + theSection = "Visualization"; + theName = "sketch_dimension_color"; + theDefault = SKETCH_DIMENSION_COLOR; +} + void SketchPlugin_ConstraintLength::execute() { std::shared_ptr aRef = std::dynamic_pointer_cast< @@ -124,13 +132,8 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou if (!sketch()) return thePrevious; - AISObjectPtr anAIS = thePrevious; - if (!anAIS) { - anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, sketch()->coordinatePlane()); - } - std::vector aRGB = Config_PropManager::color("Visualization", "sketch_dimension_color", - SKETCH_DIMENSION_COLOR); - anAIS->setColor(aRGB[0], aRGB[1], aRGB[2]); + AISObjectPtr anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, sketch()->coordinatePlane(), + thePrevious); return anAIS; }