Salome HOME
Fix for import/export features
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintLength.cpp
index 9d996ab24028ccde370554cefbe64b3497148b90..dfdca6488f6131804db15880136a774af34cc3e8 100644 (file)
@@ -128,11 +128,6 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou
   if (!anAIS) {
     anAIS = SketcherPrs_Factory::lengthDimensionConstraint(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]);
   return anAIS;
 }
 
@@ -210,3 +205,15 @@ void SketchPlugin_ConstraintLength::attributeChanged(const std::string& theID) {
     myFlyoutUpdate = false;
   }
 }
+
+bool SketchPlugin_ConstraintLength::customisePresentation(ResultPtr theResult,
+                                    AISObjectPtr thePrs,
+                                    std::shared_ptr<GeomAPI_ICustomPrs> theDefaultPrs)
+{
+  bool isCustomized = false;
+  std::vector<int> aRGB = Config_PropManager::color("Visualization", "sketch_dimension_color",
+                                                    SKETCH_DIMENSION_COLOR);
+  isCustomized = thePrs->setColor(aRGB[0], aRGB[1], aRGB[2]);
+
+  return isCustomized;
+}