Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / Model / Model_Document.h
index 443d00c1036626f95e0fb2cf1437ac6b8ff84bab..d8743f0994d03ffe707df3d26605251531c81f6f 100644 (file)
@@ -77,7 +77,8 @@ class Model_Document : public ModelAPI_Document
   MODEL_EXPORT virtual FeaturePtr addFeature(std::string theID);
 
   //! Removes the feature from the document (with result)
-  MODEL_EXPORT virtual void removeFeature(FeaturePtr theFeature);
+  //! \param theCheck if it is false, do not check the references
+  MODEL_EXPORT virtual void removeFeature(FeaturePtr theFeature, const bool theCheck = true);
 
   //! Returns the existing feature by the label
   //! \param theLabel base label of the feature
@@ -120,6 +121,9 @@ class Model_Document : public ModelAPI_Document
   /// Creates a part results
   MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_ResultPart> createPart(
       const boost::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
+  /// Creates a group results
+  MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_ResultGroup> createGroup(
+      const boost::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex = 0);
 
   //! Returns a feature by result (owner of result)
   MODEL_EXPORT virtual boost::shared_ptr<ModelAPI_Feature>
@@ -139,7 +143,11 @@ class Model_Document : public ModelAPI_Document
   void setUniqueName(FeaturePtr theFeature);
 
   //! Synchronizes myFeatures list with the updated document
-  void synchronizeFeatures(const bool theMarkUpdated = false);
+  //! \param theMarkUpdated causes the "update" event for all features
+  //! \param theUpdateReferences causes the update of back-references
+  void synchronizeFeatures(const bool theMarkUpdated, const bool theUpdateReferences);
+  //! Synchronizes the BackReferences list in Data of Features and Results
+  void synchronizeBackRefs();
 
   //! Creates new document with binary file format
   Model_Document(const std::string theID, const std::string theKind);
@@ -167,11 +175,6 @@ class Model_Document : public ModelAPI_Document
   //! Updates the results list of the feature basing on the current data tree
   void updateResults(FeaturePtr theFeature);
 
-  //! Stores information that there is a reference to this object
-  void objectIsReferenced(const ObjectPtr& theObject);
-  //! Removes information that there is a reference to this object
-  void objectIsNotReferenced(const ObjectPtr& theObject);
-
   //! Returns all sub documents
   const std::set<std::string>& subDocuments() const {return mySubs;}
 
@@ -191,8 +194,6 @@ class Model_Document : public ModelAPI_Document
   /// All features managed by this document (not only in history of OB)
   /// For optimization mapped by labels
   NCollection_DataMap<TDF_Label, FeaturePtr> myObjs;
-  /// Results that are referenced and must be concealed for object browser
-  std::set<ResultPtr> myConcealedResults;
 
   ///< set of identifiers of sub-documents of this document
   std::set<std::string> mySubs;