Salome HOME
Fix for the #2716 comment 3 : make smash allow sub-solids selected, but "Apply" butto...
[modules/shaper.git] / src / ModelAPI / ModelAPI_ResultBody.h
index 4b40d7d216e590c91f86e392c1ea03ee3058eee6..20e0879f24f880a48337e4a02acdb3e2b39b803c 100644 (file)
@@ -36,12 +36,12 @@ class GeomAlgoAPI_MakeShape;
 * Provides a shape that may be displayed in the viewer.
 * May provide really huge results, so, working with this kind
 * of result must be optimized.
-* Also provides a conainer of sub-body result in case it is compound or compsolid.
+* Also provides a container of sub-body result in case it is compound or compsolid.
 */
 class ModelAPI_ResultBody : public ModelAPI_Result
 {
 public:
-  /// Iternal enumeration for storage the information of connected topology flag
+  /// Internal enumeration for storage the information of connected topology flag
   enum ConnectedTopologyFlag {
     ConnectionNotComputed, ///< not yet computed
     IsConnected,           ///< the topology is connected
@@ -87,7 +87,7 @@ public:
   MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_ResultBody> subResult(
     const int theIndex, bool forTree = false) const = 0;
 
-  /// Returns true if feature or reuslt belong to this composite feature as subs
+  /// Returns true if feature or result belong to this composite feature as subs
   /// Returns theIndex - zero based index of sub if found
   MODELAPI_EXPORT virtual bool isSub(ObjectPtr theObject, int& theIndex) const = 0;
 
@@ -107,16 +107,14 @@ public:
                                              const GeomShapePtr& theNewShape,
                                              const bool theIsCleanStored = true);
 
-  /// Stores the shape without naming support
-  MODELAPI_EXPORT virtual void storeWithoutNaming(const GeomShapePtr& theShape);
-
   /// Returns the shape-result produced by this feature
   MODELAPI_EXPORT virtual GeomShapePtr shape();
 
   /// Records the subshape newShape which was generated during a topological construction.
   /// As an example, consider the case of a face generated in construction of a box.
-  MODELAPI_EXPORT virtual void generated(const GeomShapePtr& theNewShape,
-                                         const std::string& theName);
+  /// Returns true if it is stored correctly (the final shape contains this new sub-shape)
+  MODELAPI_EXPORT virtual bool generated(const GeomShapePtr& theNewShape,
+    const std::string& theName, const bool theCheckIsInResult = true) = 0;
 
   /// Records the shape newShape which was generated from the shape oldShape during a topological
   /// construction. As an example, consider the case of a face generated from an edge in
@@ -131,10 +129,6 @@ public:
                                         const GeomShapePtr& theNewShape,
                                         const std::string& theName = "");
 
-  /// Records the shape oldShape which was deleted from the current label.
-  /// As an example, consider the case of a face removed by a Boolean operation.
-  MODELAPI_EXPORT virtual void deleted(const GeomShapePtr& theOldShape);
-
   /// load deleted shapes
   MODELAPI_EXPORT
   virtual void loadDeletedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
@@ -147,35 +141,18 @@ public:
   virtual void loadModifiedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
                                   const GeomShapePtr& theOldShape,
                                   const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
-                                  const std::string& theName = "");
+                                  const std::string& theName = "") = 0;
 
   /// load and orient generated shapes
   MODELAPI_EXPORT
-  virtual void loadAndOrientGeneratedShapes(GeomAlgoAPI_MakeShape* theMS,
-                                            GeomShapePtr theShapeIn,
-                                            const int theKindOfShape,
-                                            const int theTag,
-                                            const std::string& theName,
-                                            GeomAPI_DataMapOfShapeShape& theSubShapes);
+  virtual void loadGeneratedShapes(const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgo,
+                                   const GeomShapePtr& theOldShape,
+                                   const GeomAPI_Shape::ShapeType theShapeTypeToExplore,
+                                   const std::string& theName = "") = 0;
 
   /// load shapes of the first level (to be used during shape import)
   MODELAPI_EXPORT virtual void loadFirstLevel(GeomShapePtr theShape,
-                                              const std::string& theName,
-                                              int& theTag);
-
-  /// load disconnected edges
-  MODELAPI_EXPORT virtual void loadDisconnectedEdges(GeomShapePtr theShape,
-                                                     const std::string& theName,
-                                                     int& theTag);
-
-  /// load disconnected vetexes
-  MODELAPI_EXPORT virtual void loadDisconnectedVertexes(GeomShapePtr theShape,
-                                                        const std::string& theName,
-                                                        int& theTag);
-
-  /// Returns true if the latest modification of this body in the naming history
-  // is equal to the given shape
-  MODELAPI_EXPORT virtual bool isLatestEqual(const GeomShapePtr& theShape) = 0;
+                                              const std::string& theName);
 
   /// Returns true is the topology is connected.
   MODELAPI_EXPORT virtual bool isConnectedTopology() = 0;
@@ -188,6 +165,9 @@ public:
   MODELAPI_EXPORT virtual void updateSubs(const GeomShapePtr& theThisShape,
     const bool theShapeChanged = true) = 0;
 
+  /// Cleans cash related to the already stored elements
+  MODELAPI_EXPORT virtual void cleanCash() = 0;
+
 protected:
   /// Default constructor accessible only from Model_Objects
   MODELAPI_EXPORT ModelAPI_ResultBody();