Salome HOME
Main fix of this integration is in ConstraintRigid. The AIS should be created uncondi...
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintDistance.cpp
index 3891a2c6cc5eed9a0a013533322e3f5280036d11..11672f77a14bd074d4cf09d1a91ffdc1124a6bde 100644 (file)
@@ -133,11 +133,6 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi
   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;
 }
 
@@ -285,3 +280,15 @@ void SketchPlugin_ConstraintDistance::attributeChanged(const std::string& theID)
   }
 }
 
+bool SketchPlugin_ConstraintDistance::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;
+}
+