]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModelAPI/ModelAPI_Document.h
Salome HOME
Added object, attribute and data model organization in the document.
[modules/shaper.git] / src / ModelAPI / ModelAPI_Document.h
index 6f720526442bebb8f237a40ebd298136242663c7..90a6a9184341b7a7c1b0519892ba32aad4c8b39c 100644 (file)
@@ -6,9 +6,19 @@
 #define ModelAPI_Document_HeaderFile
 
 #include <ModelAPI.h>
+#include <string>
 #include <memory>
 
 class ModelAPI_Feature;
+class ModelAPI_Iterator;
+
+/// Common groups identifiers
+/// Group of parameters
+static const std::string PARAMETERS_GROUP = "Parameters";
+/// Group of constructions
+static const std::string CONSTRUCTIONS_GROUP = "Construction";
+/// Group of parts
+static const std::string PARTS_GROUP = "Parts";
 
 /**\class Model_Document
  * \ingroup DataModel
@@ -18,50 +28,57 @@ class ModelAPI_Feature;
  * Also it provides acces to this data: open/save, transactions management etc.
  * to provide access to all stored data.
  */
-
 class ModelAPI_Document
 {
 public:
-
   //! 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
-  MODELAPI_EXPORT virtual bool Load(const char* theFileName) = 0;
+  MODELAPI_EXPORT virtual bool load(const char* theFileName) = 0;
 
   //! Saves the OCAF document to the file.
   //! \param theFileName full name of the file to store
   //! \returns true if file was stored successfully
-  MODELAPI_EXPORT virtual bool Save(const char* theFileName) = 0;
+  MODELAPI_EXPORT virtual bool save(const char* theFileName) = 0;
 
   //! Removes document data
-  MODELAPI_EXPORT virtual void Close() = 0;
+  MODELAPI_EXPORT virtual void close() = 0;
 
   //! Starts a new operation (opens a tansaction)
-  MODELAPI_EXPORT virtual void StartOperation() = 0;
+  MODELAPI_EXPORT virtual void startOperation() = 0;
   //! Finishes the previously started operation (closes the transaction)
-  MODELAPI_EXPORT virtual void FinishOperation() = 0;
+  MODELAPI_EXPORT virtual void finishOperation() = 0;
   //! Aborts the operation 
-  MODELAPI_EXPORT virtual void AbortOperation() = 0;
+  MODELAPI_EXPORT virtual void abortOperation() = 0;
   //! Returns true if operation has been started, but not yet finished or aborted
-  MODELAPI_EXPORT virtual bool IsOperation() = 0;
+  MODELAPI_EXPORT virtual bool isOperation() = 0;
   //! Returns true if document was modified (since creation/opening)
-  MODELAPI_EXPORT virtual bool IsModified() = 0;
+  MODELAPI_EXPORT virtual bool isModified() = 0;
 
   //! Returns True if there are available Undos
-  MODELAPI_EXPORT virtual bool CanUndo() = 0;
+  MODELAPI_EXPORT virtual bool canUndo() = 0;
   //! Undoes last operation
-  MODELAPI_EXPORT virtual void Undo() = 0;
+  MODELAPI_EXPORT virtual void undo() = 0;
   //! Returns True if there are available Redos
-  MODELAPI_EXPORT virtual bool CanRedo() = 0;
+  MODELAPI_EXPORT virtual bool canRedo() = 0;
   //! Redoes last operation
-  MODELAPI_EXPORT virtual void Redo() = 0;
+  MODELAPI_EXPORT virtual void redo() = 0;
 
-  //! Adds to the document the new object of the given group id
+  //! Adds to the document the new feature of the given group id
   //! \param theFeature a feature object that will be connected to the document in this method
-  //! \param theGroupID identifier of the groups of objects (must be greater than zero)
-  MODELAPI_EXPORT virtual void AddObject(std::shared_ptr<ModelAPI_Feature> theFeature,
-    const int theGroupID) = 0;
+  //! \param theGroupID identifier of the groups of object
+  MODELAPI_EXPORT virtual void addFeature(std::shared_ptr<ModelAPI_Feature> theFeature,
+    const std::string theGroupID) = 0;
+
+  ///! Adds a new sub-document by the identifier, or returns existing one if it is already exist
+  MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Document> subDocument(std::string theDocID) = 0;
+
+  ///! Creates an iterator of the features by the specific groups
+  MODELAPI_EXPORT virtual std::shared_ptr<ModelAPI_Iterator> featuresIterator(
+    const std::string theGroup) = 0;
+
+  MODELAPI_EXPORT virtual const std::string& id() const = 0;
 
 protected:
   /// Only for SWIG wrapping it is here