1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Model_ResultBody.cpp
4 // Created: 08 Jul 2014
5 // Author: Mikhail PONIKAROV
7 #include <Model_ResultBody.h>
8 #include <Model_BodyBuilder.h>
9 #include <ModelAPI_AttributeIntArray.h>
10 #include <ModelAPI_Tools.h>
11 #include <Config_PropManager.h>
13 //#include <TCollection_AsciiString.hxx>
14 //#include <TDF_Tool.hxx>
15 //#define DEB_IMPORT 1
17 Model_ResultBody::Model_ResultBody()
19 myBuilder = new Model_BodyBuilder(this);
22 void Model_ResultBody::initAttributes()
24 // append the color attribute. It is empty, the attribute will be filled by a request
25 DataPtr aData = data();
26 aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId());
29 void Model_ResultBody::colorConfigInfo(std::string& theSection, std::string& theName,
30 std::string& theDefault)
32 theSection = "Visualization";
33 theName = "result_body_color";
34 theDefault = DEFAULT_COLOR();
37 bool Model_ResultBody::setDisabled(std::shared_ptr<ModelAPI_Result> theThis, const bool theFlag)
39 bool aChanged = ModelAPI_ResultBody::setDisabled(theThis, theFlag);
40 if (aChanged) { // state is changed, so modifications are needed
41 myBuilder->evolutionToSelection(theFlag);
46 bool Model_ResultBody::isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape)
48 return myBuilder->isLatestEqual(theShape);
51 bool Model_ResultBody::isConcealed()
53 if (ModelAPI_ResultBody::isConcealed())
55 ResultPtr aThis = std::dynamic_pointer_cast<ModelAPI_Result>(data()->owner());
57 ResultCompSolidPtr aParent = ModelAPI_Tools::compSolidOwner(aThis);
59 if (aParent->isConcealed())