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_ResultBody
19 * \brief The body (shape) result of a feature.
21 * Provides a shape that may be displayed in the viewer.
22 * May provide really huge results, so, working with this kind
23 * of result must be optimized.
25 class ModelAPI_ResultBody : public ModelAPI_Result
28 MODELAPI_EXPORT virtual ~ModelAPI_ResultBody();
29 /// Returns the group identifier of this result
30 MODELAPI_EXPORT virtual std::string groupName();
32 /// Returns the group identifier of this result
33 inline static std::string group()
35 static std::string MY_GROUP = "Bodies";
39 /// default color for a result body
40 inline static const std::string& DEFAULT_COLOR()
42 static const std::string RESULT_BODY_COLOR("150,150,180");
43 return RESULT_BODY_COLOR;
46 /// Stores the shape (called by the execution method).
47 virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
49 /// Stores the generated shape (called by the execution method).
50 virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
51 const std::shared_ptr<GeomAPI_Shape>& theToShape) = 0;
53 /// Stores the modified shape (called by the execution method).
54 virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
55 const std::shared_ptr<GeomAPI_Shape>& theNewShape,
56 const int theDecomposeSolidsTag = 0) = 0;
58 /// Records the subshape newShape which was generated during a topological construction.
59 /// As an example, consider the case of a face generated in construction of a box.
60 virtual void generated(
61 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
63 /// Records the shape newShape which was generated from the shape oldShape during a topological
64 /// construction. As an example, consider the case of a face generated from an edge in
65 /// construction of a prism.
66 virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
67 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
69 /// Records the shape newShape which is a modification of the shape oldShape.
70 /// As an example, consider the case of a face split or merged in a Boolean operation.
71 virtual void modified(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 oldShape which was deleted from the current label.
75 /// As an example, consider the case of a face removed by a Boolean operation.
77 const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
79 /// load deleted shapes
80 virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
81 std::shared_ptr<GeomAPI_Shape> theShapeIn,
82 const int theKindOfShape,
83 const int theTag) = 0;
84 /// load and orient modified shapes
85 virtual void loadAndOrientModifiedShapes (
86 GeomAlgoAPI_MakeShape* theMS,
87 std::shared_ptr<GeomAPI_Shape> theShapeIn,
88 const int theKindOfShape,
90 const std::string& theName,
91 GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
92 /// load and orient generated shapes
93 virtual void loadAndOrientGeneratedShapes (
94 GeomAlgoAPI_MakeShape* theMS,
95 std::shared_ptr<GeomAPI_Shape> theShapeIn,
96 const int theKindOfShape,
98 const std::string& theName,
99 GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
101 /// load shapes of the first level (to be used during shape import)
102 virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag) = 0;
104 /// load disconnected edges
105 virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag) = 0;
107 /// load disconnected vetexes
108 virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName,int& theTag) = 0;
113 //! Pointer on feature object
114 typedef std::shared_ptr<ModelAPI_ResultBody> ResultBodyPtr;