Salome HOME
Merge branch 'BR_internationalization'
[modules/shaper.git] / src / ModelAPI / ModelAPI_ResultBody.h
index 272d94e3e6e50e89183fefd4926a953327024e29..119978c6f5a896a0cc24f2c2259f6344be9f1471 100644 (file)
@@ -44,8 +44,20 @@ public:
     return RESULT_BODY_COLOR;
   }
 
-  /// Stores the shape (called by the execution method).
-  MODELAPI_EXPORT virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape);
+  /// Iternal enumeration for storage the information of connected topology flag
+  enum ConnectedTopologyFlag {
+    ConnectionNotComputed, ///< not yet computed
+    IsConnected,           ///< the topology is connected
+    IsNotConnected         ///< the topology is connected
+  };
+  /// Keeps (not persistently) the connected topology flag
+  ConnectedTopologyFlag myConnect;
+
+  /// \brief Stores the shape (called by the execution method).
+  /// param[in] theShape shape to store.
+  /// param[in] theIsStoreSameShapes if false stores reference to the same shape if it is already in document.
+  MODELAPI_EXPORT virtual void store(const std::shared_ptr<GeomAPI_Shape>& theShape,
+                                     const bool theIsStoreSameShapes = true);
 
   /// Stores the generated shape (called by the execution method).
   MODELAPI_EXPORT virtual void storeGenerated(const std::shared_ptr<GeomAPI_Shape>& theFromShape,
@@ -93,7 +105,7 @@ public:
   /// load and orient modified shapes
   MODELAPI_EXPORT virtual void loadAndOrientModifiedShapes (GeomAlgoAPI_MakeShape* theMS,
     std::shared_ptr<GeomAPI_Shape>  theShapeIn, const int  theKindOfShape, const int  theTag,
-    const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes);
+    const std::string& theName, GeomAPI_DataMapOfShapeShape& theSubShapes, const bool theIsStoreSeparate = false);
   /// load and orient generated shapes
   MODELAPI_EXPORT virtual void loadAndOrientGeneratedShapes (GeomAlgoAPI_MakeShape* theMS,
     std::shared_ptr<GeomAPI_Shape>  theShapeIn, const int  theKindOfShape,
@@ -115,6 +127,10 @@ public:
   // is equal to the given shape
   MODELAPI_EXPORT virtual bool isLatestEqual(const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
 
+  /// Returns true is the topology is connected. Cashes this information for the current shape,
+  /// so it is more effective to use this method than directly GeomAPI_Shape.
+  MODELAPI_EXPORT virtual bool isConnectedTopology();
+
 protected:
   /// Default constructor accessible only from Model_Objects
   MODELAPI_EXPORT ModelAPI_ResultBody();