Salome HOME
Fixed validators for Boolean and Intersection
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintRadius.cpp
index 03854444b38043e20e2ada403933b0f5a63849f7..f4bf1708fc2273349078a8a8a88c8d0c637068ee 100644 (file)
@@ -40,6 +40,14 @@ void SketchPlugin_ConstraintRadius::initAttributes()
   data()->addAttribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT(), GeomDataAPI_Point2D::typeId());
 }
 
+void SketchPlugin_ConstraintRadius::colorConfigInfo(std::string& theSection, std::string& theName,
+                                                    std::string& theDefault)
+{
+  theSection = "Visualization";
+  theName = "sketch_dimension_color";
+  theDefault = SKETCH_DIMENSION_COLOR;
+}
+
 void SketchPlugin_ConstraintRadius::execute()
 {
   std::shared_ptr<ModelAPI_AttributeRefAttr> aRef = std::dynamic_pointer_cast<
@@ -144,15 +152,8 @@ AISObjectPtr SketchPlugin_ConstraintRadius::getAISObject(AISObjectPtr thePreviou
   if (!sketch())
     return thePrevious;
 
-  AISObjectPtr anAIS = thePrevious;
-  if (!anAIS) {
-    anAIS = SketcherPrs_Factory::radiusConstraint(this, sketch()->coordinatePlane());
-  }
-
-  // Set color from preferences
-  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::radiusConstraint(this, sketch()->coordinatePlane(),
+                                                             thePrevious);
   return anAIS;
 }