Salome HOME
Update state of Apply and Continue button
[modules/shaper.git] / src / Model / Model_Document.h
index 457a8717b79ea5060b243e14d77440e5608e1d9e..277c822ba629730adc39a796a6a78192f72afcc2 100644 (file)
@@ -56,6 +56,17 @@ class Model_Document : public ModelAPI_Document
   MODEL_EXPORT virtual bool load(
     const char* theDirName, const char* theFileName, DocumentPtr theThis);
 
+  //! Loads the OCAF document from the file into the current document.
+  //! All the features are added after the active feature.
+  //! \param theFileName name of the file to import
+  //! \param theImported list of features imported from the file
+  //! \param theCheckOnly verify the document does not contain unappropriate features
+  //!                     (useful for import to PartSet), but do not import it
+  //! \returns true if file was loaded successfully
+  MODEL_EXPORT virtual bool importPart(const char* theFileName,
+                                   std::list<std::shared_ptr<ModelAPI_Feature> >& theImported,
+                                   bool theCheckOnly = false);
+
   //! Saves the OCAF document to the file.
   //! \param theDirName directory where the document will be saved
   //! \param theFileName a name of the document file to store
@@ -64,6 +75,12 @@ class Model_Document : public ModelAPI_Document
   MODEL_EXPORT virtual bool save(
     const char* theDirName, const char* theFileName, std::list<std::string>& theResults);
 
+  //! Export the list of features to the file
+  //! \param theFilename path to save the file
+  //! \param theExportFeatures list of features to export
+  MODEL_EXPORT virtual bool save(const char* theFilename,
+    const std::list<std::shared_ptr<ModelAPI_Feature> >& theExportFeatures) const;
+
   //! Removes document data
   //! \param theForever if it is false, document is just hidden
   //!                   (to keep possibility make it back on Undo/Redo)
@@ -85,8 +102,6 @@ class Model_Document : public ModelAPI_Document
   MODEL_EXPORT virtual bool canUndo();
   //! Undoes last operation
   MODEL_EXPORT virtual void undo();
-  //! Clean the undo list
-  MODEL_EXPORT virtual void clearUndos();
   //! Returns True if there are available Redo-s
   MODEL_EXPORT virtual bool canRedo();
   //! Redoes last operation
@@ -112,7 +127,8 @@ class Model_Document : public ModelAPI_Document
   MODEL_EXPORT virtual void removeFeature(FeaturePtr theFeature);
 
   //! Moves the feature to make it after the given one in the history.
-  MODEL_EXPORT virtual void moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis);
+  MODEL_EXPORT virtual void moveFeature(
+    FeaturePtr theMoved, FeaturePtr theAfterThis, const bool theSplit = false);
 
   //! Returns the first found object in the group by the object name
   //! \param theGroupID group that contains an object