Salome HOME
Fillet on auxiliary lines fix
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintLength.cpp
index 575c0f10a9f9a620ee01a97802eea42e44dcccff..949908b293f628672969fdd7e52a85d5b3204d34 100644 (file)
@@ -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<ModelAPI_AttributeRefAttr> 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<int> 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;
 }