1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_ResultBody.hxx
4 // Created: 07 Jul 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef ModelAPI_ResultBody_H_
8 #define ModelAPI_ResultBody_H_
10 #include "ModelAPI_Result.h"
11 #include <GeomAPI_Shape.h>
12 //#include <GeomAlgoAPI_MakeShape.h>
13 //#include <GeomAPI_DataMapOfShapeShape.h>
17 class ModelAPI_BodyBuilder;
19 /**\class ModelAPI_ResultBody
21 * \brief The body (shape) result of a feature.
23 * Provides a shape that may be displayed in the viewer.
24 * May provide really huge results, so, working with this kind
25 * of result must be optimized.
27 class ModelAPI_ResultBody : public ModelAPI_Result
30 MODELAPI_EXPORT virtual ~ModelAPI_ResultBody();
31 /// Returns the group identifier of this result
32 MODELAPI_EXPORT virtual std::string groupName();
34 /// Returns the group identifier of this result
35 inline static std::string group()
37 static std::string MY_GROUP = "Bodies";
41 /// default color for a result body
42 inline static const std::string& DEFAULT_COLOR()
44 static const std::string RESULT_BODY_COLOR("150,150,180");
45 return RESULT_BODY_COLOR;
48 /// Returns the builder, which processes the shapes
49 ModelAPI_BodyBuilder* getBodyBuilder() { return myBuilder; }
51 /// Stores the shape (called by the execution method).
52 /*virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
54 /// Stores the generated shape (called by the execution method).
55 virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
56 const std::shared_ptr<GeomAPI_Shape>& theToShape) = 0;
58 /// Stores the modified shape (called by the execution method).
59 virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
60 const std::shared_ptr<GeomAPI_Shape>& theNewShape,
61 const int theDecomposeSolidsTag = 0) = 0;
63 /// Records the subshape newShape which was generated during a topological construction.
64 /// As an example, consider the case of a face generated in construction of a box.
65 virtual void generated(
66 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
68 /// Records the shape newShape which was generated from the shape oldShape during a topological
69 /// construction. As an example, consider the case of a face generated from an edge in
70 /// construction of a prism.
71 virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
72 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
74 /// Records the shape newShape which is a modification of the shape oldShape.
75 /// As an example, consider the case of a face split or merged in a Boolean operation.
76 virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
77 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
79 /// Records the shape oldShape which was deleted from the current label.
80 /// As an example, consider the case of a face removed by a Boolean operation.
82 const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
84 /// load deleted shapes
85 virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
86 std::shared_ptr<GeomAPI_Shape> theShapeIn,
87 const int theKindOfShape,
88 const int theTag) = 0;
89 /// load and orient modified shapes
90 virtual void loadAndOrientModifiedShapes (
91 GeomAlgoAPI_MakeShape* theMS,
92 std::shared_ptr<GeomAPI_Shape> theShapeIn,
93 const int theKindOfShape,
95 const std::string& theName,
96 GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
97 /// load and orient generated shapes
98 virtual void loadAndOrientGeneratedShapes (
99 GeomAlgoAPI_MakeShape* theMS,
100 std::shared_ptr<GeomAPI_Shape> theShapeIn,
101 const int theKindOfShape,
103 const std::string& theName,
104 GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
106 /// load shapes of the first level (to be used during shape import)
107 virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag) = 0;
109 /// load disconnected edges
110 virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag) = 0;
112 /// load disconnected vetexes
113 virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName,int& theTag) = 0;
116 MODELAPI_EXPORT ModelAPI_ResultBody();
119 ModelAPI_BodyBuilder* myBuilder; /// provide the body processing in naming shape
122 //! Pointer on feature object
123 typedef std::shared_ptr<ModelAPI_ResultBody> ResultBodyPtr;