Salome HOME
Fix for the issue #937 and crashes:
[modules/shaper.git] / src / Model / Model_Objects.h
index 52df4520097e57b15770b8137f0c9d5281b5ad61..0b11f4436c05ddf72e05ab68487086bc7e5177e6 100644 (file)
@@ -16,6 +16,7 @@
 #include <TDocStd_Document.hxx>
 #include <NCollection_DataMap.hxx>
 #include <TDF_Label.hxx>
+#include <TDF_LabelList.hxx>
 #include <map>
 #include <set>
 #include <vector>
@@ -94,7 +95,7 @@ class Model_Objects
   //! Returns the feature by zero-based index: features in the history or not
   std::shared_ptr<ModelAPI_Feature> internalFeature(const int theIndex);
 
-  /// Creates a construction cresults
+  /// Creates a construction results
   std::shared_ptr<ModelAPI_ResultConstruction> createConstruction(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
   /// Creates a body results
@@ -103,6 +104,10 @@ class Model_Objects
   /// Creates a part results
   std::shared_ptr<ModelAPI_ResultPart> createPart(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
+  /// Copies a part results, keeping the reference to origin
+  std::shared_ptr<ModelAPI_ResultPart> copyPart(
+      const std::shared_ptr<ModelAPI_ResultPart>& theOrigin,
+      const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
   /// Creates a group results
   std::shared_ptr<ModelAPI_ResultGroup> createGroup(
       const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
@@ -133,10 +138,10 @@ class Model_Objects
   void setUniqueName(FeaturePtr theFeature);
 
   //! Synchronizes myFeatures list with the updated document
-  //! \param theMarkUpdated causes the "update" event for all features
+  //! \param theUpdated list of labels that are marked as modified, so featrues must be also
   //! \param theUpdateReferences causes the update of back-references
   //! \param theFlush makes flush all events in the end of all modifications of this method
-  void synchronizeFeatures(const bool theMarkUpdated, const bool theUpdateReferences,
+  void synchronizeFeatures(const TDF_LabelList& theUpdated, const bool theUpdateReferences,
     const bool theFlush);
   //! Synchronizes the BackReferences list in Data of Features and Results
   void synchronizeBackRefs();
@@ -177,6 +182,8 @@ class Model_Objects
   FeaturePtr firstFeature();
   /// Returns to the last (from the history point of view) feature, any: invisible or disabled
   FeaturePtr lastFeature();
+  /// Returns true if theLater is in history of features creation later than theCurrent
+  bool isLater(FeaturePtr theLater, FeaturePtr theCurrent) const;
 
   /// Returns the result group identifier of the given feature (for this at least one result must 
   /// be created before)