Salome HOME
Issue #355 Delete: elements of sketch and constraints
[modules/shaper.git] / src / Model / Model_Document.h
index 56490a15c337b60a825b729215da58567411df97..cb99181f9ddb8a9ce6b1d2233d0f6c508701edb6 100644 (file)
@@ -40,7 +40,6 @@ class Model_Document : public ModelAPI_Document
 
   //! Loads the OCAF document from the file.
   //! \param theFileName full name of the file to load
-  //! \param theStudyID identifier of the SALOME study to associate with loaded file
   //! \returns true if file was loaded successfully
   MODEL_EXPORT virtual bool load(const char* theFileName);
 
@@ -57,8 +56,8 @@ class Model_Document : public ModelAPI_Document
   //! Starts a new operation (opens a tansaction)
   MODEL_EXPORT virtual void startOperation();
   //! Finishes the previously started operation (closes the transaction)
-  //! Returns true if transaction in this document is not empty and really was performed
-  MODEL_EXPORT virtual void finishOperation();
+  //! \returns true if transaction in this document is not empty and really was performed
+  MODEL_EXPORT virtual bool finishOperation();
   //! Aborts the operation 
   MODEL_EXPORT virtual void abortOperation();
   //! Returns true if operation has been started, but not yet finished or aborted
@@ -76,12 +75,20 @@ class Model_Document : public ModelAPI_Document
   MODEL_EXPORT virtual void redo();
 
   //! Adds to the document the new feature of the given feature id
-  //! \param creates feature and puts it in the document
+  //! \param theID creates feature and puts it in the document
   MODEL_EXPORT virtual FeaturePtr addFeature(std::string theID);
 
+  //! Return a list of features, which refers to the feature
+  //! \param theFeature a feature
+  //! \param theRefs a list of reference features
+  //! \param isSendError a flag whether the error message should be send
+  MODEL_EXPORT virtual void refsToFeature(FeaturePtr theFeature,
+                                          std::set<FeaturePtr>& theRefs,
+                                          const bool isSendError = true);
+
   //! Removes the feature from the document (with result)
-  //! \param theCheck if it is false, do not check the references
-  MODEL_EXPORT virtual void removeFeature(FeaturePtr theFeature, const bool theCheck = true);
+  //! \param theFeature a removed feature
+  MODEL_EXPORT virtual void removeFeature(FeaturePtr theFeature);
 
   //! Returns the existing feature by the label
   //! \param theLabel base label of the feature
@@ -106,7 +113,6 @@ class Model_Document : public ModelAPI_Document
   //! Returns the feature in the group by the index (started from zero)
   //! \param theGroupID group that contains a feature
   //! \param theIndex zero-based index of feature in the group
-  //! \param isOperation if it is true, returns feature (not Object)
   //! \param theHidden if it is true, it counts also the features that are not in tree
   MODEL_EXPORT virtual ObjectPtr object(const std::string& theGroupID, const int theIndex,
                                         const bool theHidden = false);
@@ -163,6 +169,7 @@ class Model_Document : public ModelAPI_Document
   //! Creates new document with binary file format
   Model_Document(const std::string theID, const std::string theKind);
 
+  //! Returns the internal OCCT document of this interface
   Handle_TDocStd_Document document()
   {
     return myDoc;
@@ -190,7 +197,7 @@ class Model_Document : public ModelAPI_Document
   const std::set<std::string> subDocuments(const bool theActivatedOnly) const;
 
   //! The implementation of undo: with or without recoursive calls in the sub-documents
-  void undoInternal(const bool theWithSubs);
+  void undoInternal(const bool theWithSubs, const bool theSynchronize);
 
   friend class Model_Application;
   friend class Model_Session;