Salome HOME
Constriction type for all sketch entities
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Plane.cpp
index 5475402437a3a707cf5e5dbb3ef90dc55be4f413..d0ecc4d7ee88012e5f239c892402f118851862a1 100644 (file)
@@ -6,6 +6,8 @@
 
 #include "ConstructionPlugin_Plane.h"
 
+#include <Config_PropManager.h>
+
 #include <ModelAPI_AttributeSelection.h>
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_ResultConstruction.h>
@@ -22,14 +24,14 @@ ConstructionPlugin_Plane::ConstructionPlugin_Plane()
 
 void ConstructionPlugin_Plane::initAttributes()
 {
-  data()->addAttribute(FACE_ATTR,  ModelAPI_AttributeSelection::type());
-  data()->addAttribute(DISTANCE_ATTR, ModelAPI_AttributeDouble::type());
+  data()->addAttribute(ConstructionPlugin_Plane::FACE(),  ModelAPI_AttributeSelection::type());
+  data()->addAttribute(ConstructionPlugin_Plane::DISTANCE(), ModelAPI_AttributeDouble::type());
 }
 
 void ConstructionPlugin_Plane::execute()
 {
-  AttributeSelectionPtr aFaceAttr = data()->selection(FACE_ATTR);
-  AttributeDoublePtr aDistAttr = data()->real(DISTANCE_ATTR);
+  AttributeSelectionPtr aFaceAttr = data()->selection(ConstructionPlugin_Plane::FACE());
+  AttributeDoublePtr aDistAttr = data()->real(ConstructionPlugin_Plane::DISTANCE());
   if ((aFaceAttr.get() != NULL) && (aDistAttr.get() != NULL) && 
     aFaceAttr->isInitialized() && aDistAttr->isInitialized()) {
 
@@ -73,6 +75,8 @@ void ConstructionPlugin_Plane::execute()
 
 void ConstructionPlugin_Plane::customisePresentation(AISObjectPtr thePrs)
 {
-  thePrs->setColor(50, 255, 50);
+  std::vector<int> aRGB = Config_PropManager::color("Visualization", "construction_plane_color",
+                                                    ConstructionPlugin_Plane::DEFAULT_COLOR());
+  thePrs->setColor(aRGB[0], aRGB[1], aRGB[2]);
   thePrs->setTransparensy(0.6);
-}
\ No newline at end of file
+}