Salome HOME
[PythonAPI] Fix error in parameter wrapper
[modules/shaper.git] / src / Model / Model_ResultBody.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        Model_ResultBody.cpp
4 // Created:     08 Jul 2014
5 // Author:      Mikhail PONIKAROV
6
7 #include <Model_ResultBody.h>
8 #include <Model_BodyBuilder.h>
9 #include <ModelAPI_AttributeIntArray.h>
10 #include <Config_PropManager.h>
11 // DEB
12 //#include <TCollection_AsciiString.hxx>
13 //#include <TDF_Tool.hxx>
14 //#define DEB_IMPORT 1
15
16 Model_ResultBody::Model_ResultBody()
17 {
18   myBuilder = new Model_BodyBuilder(this);
19 }
20
21 void Model_ResultBody::initAttributes()
22 {
23   // append the color attribute. It is empty, the attribute will be filled by a request
24   DataPtr aData = data();
25   aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId());
26 }
27
28 void Model_ResultBody::colorConfigInfo(std::string& theSection, std::string& theName,
29   std::string& theDefault)
30 {
31   theSection = "Visualization";
32   theName = "result_body_color";
33   theDefault = DEFAULT_COLOR();
34 }
35
36 bool Model_ResultBody::setDisabled(std::shared_ptr<ModelAPI_Result> theThis, const bool theFlag)
37 {
38   bool aChanged = ModelAPI_ResultBody::setDisabled(theThis, theFlag);
39   if (aChanged) { // state is changed, so modifications are needed
40     myBuilder->evolutionToSelection(theFlag);
41   }
42   return aChanged;
43 }
44
45 bool Model_ResultBody::isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape)
46 {
47   return myBuilder->isLatestEqual(theShape);
48 }