Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / Model / Model_ResultBody.cpp
index 1351c260e9febc2b81081eafeb6d0ed91b308ecc..2bdea7f5f30bdf54fbd2db814dccdc2b16615f1e 100644 (file)
@@ -7,6 +7,7 @@
 #include <Model_ResultBody.h>
 #include <Model_Data.h>
 #include <Model_Document.h>
+#include <ModelAPI_AttributeIntArray.h>
 #include <TNaming_Builder.hxx>
 #include <TNaming_NamedShape.hxx>
 #include <TDataStd_Name.hxx>
@@ -30,6 +31,7 @@
 #include <BRep_Tool.hxx>
 #include <GeomAPI_Shape.h>
 #include <GeomAlgoAPI_MakeShape.h>
+#include <Config_PropManager.h>
 // DEB
 //#include <TCollection_AsciiString.hxx>
 //#include <TDF_Tool.hxx>
@@ -40,6 +42,21 @@ Model_ResultBody::Model_ResultBody()
   setIsConcealed(false);
 }
 
+void Model_ResultBody::initAttributes()
+{
+  // 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());
+}
+
+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)
 {
   std::shared_ptr<Model_Data> aData = std::dynamic_pointer_cast<Model_Data>(data());
@@ -652,4 +669,4 @@ void Model_ResultBody::loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> t
                theTag++;
        }
   }
-}
\ No newline at end of file
+}