Salome HOME
Issue #2562: CEA 2018-1 Fuse
[modules/shaper.git] / src / Model / Model_ResultBody.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef Model_ResultBody_H_
22 #define Model_ResultBody_H_
23
24 #include "Model.h"
25 #include <ModelAPI_ResultBody.h>
26 //#include <GeomAlgoAPI_MakeShape.h>
27 //#include <GeomAPI_DataMapOfShapeShape.h>
28 //#include <vector>
29
30 //class TNaming_Builder;
31
32 /**\class Model_ResultBody
33  * \ingroup DataModel
34  * \brief The body (shape) result of a feature.
35  *
36  * Provides a shape that may be displayed in the viewer.
37  * May provide really huge results, so, working with this kind
38  * of result must be optimized.
39  */
40 class Model_ResultBody : public ModelAPI_ResultBody
41 {
42   /// builders that tores the naming history: one per label to allow store several shapes to one
43   /// label; index in vector corresponds to the label tag
44   //std::vector<TNaming_Builder*> myBuilders;
45
46   /// Flag that stores the previous state of "concealed": if it is changed,
47   /// The event is used to redisplay the body.
48   bool myWasConcealed;
49
50 public:
51   /// Returns the parameters of color definition in the resources config manager
52   MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName,
53                                             std::string& theDefault);
54
55   /// Disables the result body: keeps the resulting shape as selection, but erases the underlaying
56   /// naming data structure if theFlag if false. Or restores everything on theFlag is true.
57   MODEL_EXPORT virtual bool setDisabled(std::shared_ptr<ModelAPI_Result> theThis,
58     const bool theFlag);
59
60   /// The compsolid is concealed if at least one of the sub is concealed,
61   /// so, sub is Concealed if at least one sub is concealed
62   MODEL_EXPORT virtual bool isConcealed();
63
64   /// Returns true if the latest modification of this body in the naming history
65   // is equal to the given shape
66   MODEL_EXPORT virtual bool isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape);
67
68   /// Removes the stored builders
69   MODEL_EXPORT virtual ~Model_ResultBody() {};
70
71 protected:
72   /// Makes a body on the given feature
73   Model_ResultBody();
74
75   friend class Model_Objects;
76 };
77
78 #endif