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 /// Returns the group identifier of this result
29 virtual std::string groupName()
34 /// Returns the group identifier of this result
35 static std::string group()
37 static std::string MY_GROUP = "Bodies";
41 /// Stores the shape (called by the execution method).
42 virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
44 /// Stores the generated shape (called by the execution method).
45 virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
46 const std::shared_ptr<GeomAPI_Shape>& theToShape) = 0;
48 /// Stores the modified shape (called by the execution method).
49 virtual void storeModified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
50 const std::shared_ptr<GeomAPI_Shape>& theNewShape) = 0;
52 /// Records the subshape newShape which was generated during a topological construction.
53 /// As an example, consider the case of a face generated in construction of a box.
54 virtual void generated(
55 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
57 /// Records the shape newShape which was generated from the shape oldShape during a topological
58 /// construction. As an example, consider the case of a face generated from an edge in
59 /// construction of a prism.
60 virtual void generated(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
61 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
63 /// Records the shape newShape which is a modification of the shape oldShape.
64 /// As an example, consider the case of a face split or merged in a Boolean operation.
65 virtual void modified(const std::shared_ptr<GeomAPI_Shape>& theOldShape,
66 const std::shared_ptr<GeomAPI_Shape>& theNewShape, const std::string& theName, const int theTag = 1) = 0;
68 /// Records the shape oldShape which was deleted from the current label.
69 /// As an example, consider the case of a face removed by a Boolean operation.
71 const std::shared_ptr<GeomAPI_Shape>& theOldShape, const int theTag = 1) = 0;
73 /// load deleted shapes
74 virtual void loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS,
75 std::shared_ptr<GeomAPI_Shape> theShapeIn,
76 const int theKindOfShape,
77 const int theTag) = 0;
78 /// load and orient modified shapes
79 virtual void loadAndOrientModifiedShapes (
80 GeomAlgoAPI_MakeShape* theMS,
81 std::shared_ptr<GeomAPI_Shape> theShapeIn,
82 const int theKindOfShape,
84 const std::string& theName,
85 GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
86 /// load and orient generated shapes
87 virtual void loadAndOrientGeneratedShapes (
88 GeomAlgoAPI_MakeShape* theMS,
89 std::shared_ptr<GeomAPI_Shape> theShapeIn,
90 const int theKindOfShape,
92 const std::string& theName,
93 GeomAPI_DataMapOfShapeShape& theSubShapes) = 0;
95 /// load shapes of the first level (to be used during shape import)
96 virtual void loadFirstLevel(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag) = 0;
98 /// load disconnected edges
99 virtual void loadDisconnectedEdges(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName, int& theTag) = 0;
101 /// load disconnected vetexes
102 virtual void loadDisconnectedVertexes(std::shared_ptr<GeomAPI_Shape> theShape, const std::string& theName,int& theTag) = 0;
107 //! Pointer on feature object
108 typedef std::shared_ptr<ModelAPI_ResultBody> ResultBodyPtr;