X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Document.h;h=a5ad181f06e2d1387d02f4e10ff4529c6e7b4302;hb=207f4e84daf9c78020f5f250a33a63c71f0b0556;hp=6e368d7e4e3003e9b53a4dea28cc64e93bb1536a;hpb=6e421e939851e0de46554ae45a3ca0e1f67cd91d;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Document.h b/src/ModelAPI/ModelAPI_Document.h index 6e368d7e4..a5ad181f0 100644 --- a/src/ModelAPI/ModelAPI_Document.h +++ b/src/ModelAPI/ModelAPI_Document.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2022 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -81,7 +81,8 @@ public: //! Moves the feature to make it after the given one in the history. virtual void moveFeature(std::shared_ptr theMoved, - std::shared_ptr theAfterThis) = 0; + std::shared_ptr theAfterThis, + const bool theSplit = false) = 0; ///! Returns the id of the document virtual const int id() const = 0; @@ -99,7 +100,7 @@ public: //! \param theName name of the object to search //! \returns null if such object is not found virtual std::shared_ptr objectByName(const std::string& theGroupID, - const std::string& theName) = 0; + const std::wstring& theName) = 0; //! Returns the object index in the group. Object must be visible. Otherwise returns -1. //! \param theObject object of this document @@ -253,6 +254,29 @@ public: /// Just removes all features without touching the document data (to be able undo) MODELAPI_EXPORT virtual void eraseAllFeatures() = 0; + /// Returns the next (from the history point of view) feature, any: invisible or disabled + /// \param theCurrent previous to the resulting feature + /// \param theReverse if it is true, iterates in reversed order (next becomes previous) + MODELAPI_EXPORT virtual std::shared_ptr nextFeature( + std::shared_ptr theCurrent, const bool theReverse = false) const = 0; + + /// 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 + MODELAPI_EXPORT virtual bool importPart(const char* theFileName, + std::list >& theImported, + bool theCheckOnly = false) = 0; + + /// Export the list of features to the file + /// \param theFilename path to save the file + /// \param theExportFeatures list of features to export + MODELAPI_EXPORT virtual bool save(const char* theFilename, + const std::list >& theExportFeatures) const = 0; + protected: //! Only for SWIG wrapping it is here MODELAPI_EXPORT ModelAPI_Document();