Salome HOME
Issue #459: Check pre-selection for group operation
[modules/shaper.git] / src / Model / Model_ResultBody.cpp
index 7b7e3c3be3a8eab1722a97f0a049137e33274161..7708c92cfbda5f6707876e72b6e6e49db579d23f 100644 (file)
@@ -37,8 +37,6 @@
 //#include <TDF_Tool.hxx>
 //#define DEB_IMPORT 1
 
-#define RESULT_BODY_COLOR "#E0A01B"
-
 Model_ResultBody::Model_ResultBody()
 {
   setIsConcealed(false);
@@ -46,16 +44,17 @@ Model_ResultBody::Model_ResultBody()
 
 void Model_ResultBody::initAttributes()
 {
-  // append the color attribute
+  // append the color attribute. It is empty, the attribute will be filled by a request
   DataPtr aData = data();
-  aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::type());
-  AttributeIntArrayPtr aColorAttr = aData->intArray(COLOR_ID());
-  std::vector<int> aRGB;
-  aRGB = Config_PropManager::color("Visualization", "result_body_color", RESULT_BODY_COLOR);
-  aColorAttr->setSize(3);
-  aColorAttr->setValue(0, aRGB[0]);
-  aColorAttr->setValue(1, aRGB[1]);
-  aColorAttr->setValue(2, aRGB[2]);
+  aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId());
+}
+
+void Model_ResultBody::colorConfigInfo(std::string& theSection, std::string& theName,
+                                       std::string& theDefault)
+{
+  theSection = "Visualization";
+  theName = "result_body_color";
+  theDefault = DEFAULT_COLOR();
 }
 
 void Model_ResultBody::store(const std::shared_ptr<GeomAPI_Shape>& theShape)