Salome HOME
be5ac8e1dba9c7eae478450aacd1654c94559e0f
[modules/shaper.git] / src / Model / Model_ResultBody.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        Model_ResultBody.h
4 // Created:     08 Jul 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef Model_ResultBody_H_
8 #define Model_ResultBody_H_
9
10 #include "Model.h"
11 #include <ModelAPI_ResultBody.h>
12 //#include <GeomAlgoAPI_MakeShape.h>
13 //#include <GeomAPI_DataMapOfShapeShape.h>
14 //#include <vector>
15
16 //class TNaming_Builder;
17
18 /**\class Model_ResultBody
19  * \ingroup DataModel
20  * \brief The body (shape) result of a feature.
21  *
22  * Provides a shape that may be displayed in the viewer.
23  * May provide really huge results, so, working with this kind
24  * of result must be optimized.
25  */
26 class Model_ResultBody : public ModelAPI_ResultBody
27 {
28   /// builders that tores the naming history: one per label to allow store several shapes to one 
29   /// label; index in vector corresponds to the label tag
30   //std::vector<TNaming_Builder*> myBuilders;
31
32   /// Flag that stores the previous state of "concealed": if it is changed,
33   /// The event is used to redisplay the body.
34   bool myWasConcealed;
35
36 public:
37   /// Request for initialization of data model of the result: adding all attributes
38   virtual void initAttributes();
39
40   /// Returns the parameters of color definition in the resources config manager
41   MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName,
42                                             std::string& theDefault);
43
44   /// Disables the result body: keeps the resulting shape as selection, but erases the underlaying
45   /// naming data structure if theFlag if false. Or restores everything on theFlag is true.
46   MODEL_EXPORT virtual bool setDisabled(std::shared_ptr<ModelAPI_Result> theThis,
47     const bool theFlag);
48
49   /// The compsolid is concealed if at least one of the sub is concealed,
50   /// so, sub is Concealed if at least one sub is concealed
51   MODEL_EXPORT virtual bool isConcealed();
52
53   /// Returns true if the latest modification of this body in the naming history
54   // is equal to the given shape
55   MODEL_EXPORT virtual bool isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape);
56
57   /// Removes the stored builders
58   MODEL_EXPORT virtual ~Model_ResultBody() {};
59
60 protected:
61   /// Makes a body on the given feature
62   Model_ResultBody();
63
64   friend class Model_Objects;
65 };
66
67 #endif