1 // File: ModelAPI_ResultBody.hxx
2 // Created: 07 Jul 2014
3 // Author: Mikhail PONIKAROV
5 #ifndef ModelAPI_ResultBody_H_
6 #define ModelAPI_ResultBody_H_
8 #include "ModelAPI_Result.h"
9 #include <GeomAPI_Shape.h>
10 #include <GeomAlgoAPI_MakeShape.h>
11 #include <GeomAPI_DataMapOfShapeShape.h>
15 /**\class ModelAPI_ResultBody
17 * \brief The body (shape) result of a feature.
19 * Provides a shape that may be displayed in the viewer.
20 * May provide really huge results, so, working with this kind
21 * of result must be optimized.
23 class ModelAPI_ResultBody : public ModelAPI_Result
26 /// Returns the group identifier of this result
27 virtual std::string groupName()
32 /// Returns the group identifier of this result
33 static std::string group()
35 static std::string MY_GROUP = "Bodies";
39 /// Stores the shape (called by the execution method).
40 virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
42 /// Stores the generated shape (called by the execution method).
43 virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
44 const std::shared_ptr<GeomAPI_Shape>& theToShape) = 0;
46 /// Stores the modified shape (called by the execution method).
47 virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
48 const std::shared_ptr<GeomAPI_Shape>& theNewShape) = 0;
50 /// Records the subshape newShape which was generated during a topological construction.
51 /// As an example, consider the case of a face generated in construction of a box.
52 virtual void generated(
53 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag = 1) = 0;
55 /// Records the shape newShape which was generated from the shape oldShape during a topological
56 /// construction. As an example, consider the case of a face generated from an edge in
57 /// construction of a prism.
58 virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
59 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag = 1) = 0;
61 /// Records the shape newShape which is a modification of the shape oldShape.
62 /// As an example, consider the case of a face split or merged in a Boolean operation.
63 virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
64 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const int theTag = 1) = 0;
66 /// Records the shape oldShape which was deleted from the current label.
67 /// As an example, consider the case of a face removed by a Boolean operation.
69 const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
71 /// load deleted shapes
72 virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
73 std::shared_ptr<GeomAPI_Shape> theShapeIn,
74 const int theKindOfShape,
75 const int theTag) = 0;
76 /// load and orient modified shapes
77 virtual void loadAndOrientModifiedShapes (
78 GeomAlgoAPI_MakeShape* theMS,
79 std::shared_ptr<GeomAPI_Shape> theShapeIn,
80 const int theKindOfShape,
82 GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
83 /// load and orient generated shapes
84 virtual void loadAndOrientGeneratedShapes (
85 GeomAlgoAPI_MakeShape* theMS,
86 std::shared_ptr<GeomAPI_Shape> theShapeIn,
87 const int theKindOfShape,
89 GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
91 /// load shapes of the first level (to be used during shape import)
92 virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, int& theTag) = 0;
94 /// load disconnected edges
95 virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, int& theTag) = 0;
97 /// load disconnected vetexes
98 virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, int& theTag) = 0;
103 //! Pointer on feature object
104 typedef std::shared_ptr<ModelAPI_ResultBody> ResultBodyPtr;