]> SALOME platform Git repositories - modules/shaper.git/blob - src/Model/Model_ResultBody.h
Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[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 email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
18 //
19
20 #ifndef Model_ResultBody_H_
21 #define Model_ResultBody_H_
22
23 #include "Model.h"
24 #include <ModelAPI_ResultBody.h>
25 //#include <GeomAlgoAPI_MakeShape.h>
26 //#include <GeomAPI_DataMapOfShapeShape.h>
27 //#include <vector>
28
29 //class TNaming_Builder;
30
31 /**\class Model_ResultBody
32  * \ingroup DataModel
33  * \brief The body (shape) result of a feature.
34  *
35  * Provides a shape that may be displayed in the viewer.
36  * May provide really huge results, so, working with this kind
37  * of result must be optimized.
38  */
39 class Model_ResultBody : public ModelAPI_ResultBody
40 {
41   /// builders that tores the naming history: one per label to allow store several shapes to one
42   /// label; index in vector corresponds to the label tag
43   //std::vector<TNaming_Builder*> myBuilders;
44
45   /// Flag that stores the previous state of "concealed": if it is changed,
46   /// The event is used to redisplay the body.
47   bool myWasConcealed;
48
49 public:
50   /// Returns the parameters of color definition in the resources config manager
51   MODEL_EXPORT virtual void colorConfigInfo(std::string& theSection, std::string& theName,
52                                             std::string& theDefault);
53
54   /// Disables the result body: keeps the resulting shape as selection, but erases the underlaying
55   /// naming data structure if theFlag if false. Or restores everything on theFlag is true.
56   MODEL_EXPORT virtual bool setDisabled(std::shared_ptr<ModelAPI_Result> theThis,
57     const bool theFlag);
58
59   /// The compsolid is concealed if at least one of the sub is concealed,
60   /// so, sub is Concealed if at least one sub is concealed
61   MODEL_EXPORT virtual bool isConcealed();
62
63   /// Returns true if the latest modification of this body in the naming history
64   // is equal to the given shape
65   MODEL_EXPORT virtual bool isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape);
66
67   /// Removes the stored builders
68   MODEL_EXPORT virtual ~Model_ResultBody() {};
69
70 protected:
71   /// Makes a body on the given feature
72   Model_ResultBody();
73
74   friend class Model_Objects;
75 };
76
77 #endif