X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Document.h;h=0bf22b98e5b450e9dcbf1ef7771a64d82a267ba9;hb=103633b49d995fe6001e226ccdcc8ca48b9cb4e6;hp=678a3f83d00466f33a40db2fb7b0aaf94ea0e277;hpb=1fc8dc0984e6bb92df544300fda9aa625ad5c05e;p=modules%2Fshaper.git diff --git a/src/Model/Model_Document.h b/src/Model/Model_Document.h index 678a3f83d..0bf22b98e 100644 --- a/src/Model/Model_Document.h +++ b/src/Model/Model_Document.h @@ -16,13 +16,10 @@ class Handle_Model_Document; /**\class Model_Document * \ingroup DataModel - * \brief Document for internal data structure of any object storage. Corresponds to the SALOME study. - * Document contains all data of te SALOME Study specific to this module - * that must be written into the HDF file. + * \brief Document for internal data structure of any object storage. + * Document contains all data that must be stored/retrived in the file. * Also it provides acces to this data: open/save, transactions management etc. - * to provide access to all stored data. */ - class Model_Document: public ModelAPI_Document { public: @@ -64,31 +61,31 @@ public: //! Adds to the document the new feature of the given feature id //! \param creates feature and puts it in the document - MODEL_EXPORT virtual std::shared_ptr addFeature(std::string theID); + MODEL_EXPORT virtual boost::shared_ptr addFeature(std::string theID); //! Returns the existing feature by the label //! \param theLabel base label of the feature - MODEL_EXPORT virtual std::shared_ptr feature(TDF_Label& theLabel); + MODEL_EXPORT virtual boost::shared_ptr feature(TDF_Label& theLabel); //! Adds a new sub-document by the identifier, or returns existing one if it is already exist - MODEL_EXPORT virtual std::shared_ptr subDocument(std::string theDocID); - - //! Creates an iterator of the features by the specific groups - MODEL_EXPORT virtual std::shared_ptr featuresIterator( - const std::string theGroup); + MODEL_EXPORT virtual boost::shared_ptr subDocument(std::string theDocID); + ///! Returns the id of hte document MODEL_EXPORT virtual const std::string& id() const {return myID;} //! Returns the feature in the group by the index (started from zero) - MODEL_EXPORT virtual std::shared_ptr + MODEL_EXPORT virtual boost::shared_ptr feature(const std::string& theGroupID, const int theIndex); + //! Returns the number of features in the group + MODEL_EXPORT virtual int size(const std::string& theGroupID); + ///! Returns the vector of groups already added to the document MODEL_EXPORT virtual const std::vector& getGroups() const; //! Returns the index of feature in the group (zero based) //! \retruns -1 if not found - MODEL_EXPORT virtual int featureIndex(std::shared_ptr theFeature); + MODEL_EXPORT virtual int featureIndex(boost::shared_ptr theFeature); protected: @@ -97,10 +94,10 @@ protected: //! Initializes feature with a unique name in this group (unique name is generated as //! feature type + "_" + index - void setUniqueName(std::shared_ptr theFeature); + void setUniqueName(boost::shared_ptr theFeature); //! Adds to the document the new feature - void addFeature(const std::shared_ptr theFeature); + void addFeature(const boost::shared_ptr theFeature); //! Synchronizes myGroups, myGroupsNames, myFeatures and mySubs list with the updated document void synchronizeFeatures(); @@ -119,7 +116,7 @@ private: std::map myGroups; std::vector myGroupsNames; ///< names of added groups to the document /// Features managed by this document: by group name - std::map > > myFeatures; + std::map > > myFeatures; std::set mySubs; ///< set of identifiers of sub-documents of this document /// transaction indexes (related to myTransactionsAfterSave) which were empty in this doc std::map myIsEmptyTr;