+ //! Returns all features of the document including the hidden features which are not in
+ //! history. Not very fast method, for calling once, not in big cycles.
+ virtual std::list<std::shared_ptr<ModelAPI_Feature> > allFeatures() = 0;
+
+ //! Returns all objects of the document including the hidden features which are not in
+ //! history. Not very fast method, for calling once, not in big cycles.
+ virtual std::list<std::shared_ptr<ModelAPI_Object> > allObjects() = 0;
+
+ //! Creates a folder (group of the features in the object browser)
+ virtual std::shared_ptr<ModelAPI_Folder> addFolder(
+ std::shared_ptr<ModelAPI_Feature> theAddBefore) = 0;
+ //! Removes the folder from the document (all features in the folder will be kept).
+ virtual void removeFolder(std::shared_ptr<ModelAPI_Folder> theFolder) = 0;
+ //! Search a folder above the list of features applicable to store them
+ //! (it means the list of features stored in the folder should be consequential)
+ //! \return Empty pointer if there is no applicable folder
+ virtual std::shared_ptr<ModelAPI_Folder> findFolderAbove(
+ const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures) = 0;
+ //! Search a folder below the list of features applicable to store them
+ //! (it means the list of features stored in the folder should be consequential)
+ //! \return Empty pointer if there is no applicable folder
+ virtual std::shared_ptr<ModelAPI_Folder> findFolderBelow(
+ const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures) = 0;
+ //! Add a list of features to the folder. The correctness of the adding is not performed
+ //! (such checks have been done in corresponding find.. method).
+ //! \return \c true if the movement is successfull
+ virtual bool moveToFolder(const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
+ const std::shared_ptr<ModelAPI_Folder>& theFolder) = 0;
+ //! Remove features from the folder
+ //! \param theFeatures list of features to be removed
+ //! \param theBefore extract features before the folder (this parameter is applicable only
+ //! when all features in the folder are taking out,
+ //! in other cases the direction is taken automatically)
+ //! \return \c true if the features have been moved out
+ virtual bool removeFromFolder(
+ const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
+ const bool theBefore = true) = 0;
+
+ //! Informs the document that it becomes active and some actions must be performed
+ virtual void setActive(const bool theFlag) = 0;
+ //! Returns true if this document is currently active
+ virtual bool isActive() const = 0;
+
+ /// Returns true if document is opened and valid
+ virtual bool isOpened() = 0;
+
+ /// Returns the feature that produced the given face of the given result.
+ virtual std::shared_ptr<ModelAPI_Feature> producedByFeature(
+ std::shared_ptr<ModelAPI_Result> theResult,
+ const std::shared_ptr<GeomAPI_Shape>& theShape) = 0;
+
+ /// Returns true if theLater is in history of features creation later than theCurrent
+ virtual bool isLater(std::shared_ptr<ModelAPI_Feature> theLater,
+ std::shared_ptr<ModelAPI_Feature> theCurrent) const = 0;
+
+ //! Internally makes document know that feature was removed or added in history after creation
+ MODELAPI_EXPORT virtual void updateHistory(const std::string theGroup) = 0;
+
+ /// Stores in the document boolean flags: states of the nodes in the object browser.
+ /// Normally is called outside of the transaction, just before "save".
+ MODELAPI_EXPORT virtual void storeNodesState(const std::list<bool>& theStates) = 0;
+
+ /// Returns the stored nodes states. Normally it is calles just after "open".
+ /// Appends the values to theStates list.
+ MODELAPI_EXPORT virtual void restoreNodesState(std::list<bool>& theStates) const = 0;
+
+ /// Just removes all features without touching the document data (to be able undo)
+ MODELAPI_EXPORT virtual void eraseAllFeatures() = 0;
+