X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Document.h;h=6aa9ef4e83578e0e0793e58107c887da9086960e;hb=a352874d231ad2b117f55cf384c18361a0dfe67a;hp=0b7a618c68119b59f67e47c7a181e98639b7c256;hpb=4b1c827abfbf7af9359088dce8f80692d4d33602;p=modules%2Fshaper.git diff --git a/src/Model/Model_Document.h b/src/Model/Model_Document.h index 0b7a618c6..6aa9ef4e8 100644 --- a/src/Model/Model_Document.h +++ b/src/Model/Model_Document.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: Model_Document.h // Created: 28 Feb 2014 // Author: Mikhail PONIKAROV @@ -83,7 +85,7 @@ class Model_Document : public ModelAPI_Document //! Returns the existing feature by the label //! \param theLabel base label of the feature - MODEL_EXPORT virtual FeaturePtr feature(TDF_Label& theLabel); + MODEL_EXPORT virtual FeaturePtr feature(TDF_Label& theLabel) const; //! Returns the existing object: result or feature //! \param theLabel base label of the object @@ -134,10 +136,15 @@ class Model_Document : public ModelAPI_Document ///! On abort, undo or redo it is not necessary: results in document are updated automatically bool executeFeatures() {return myExecuteFeatures;} + //! Registers the name of the shape for the topological naming needs + void addNamingName(const TDF_Label theLabel, std::string theName); + //! Returns the label, keeper of the name for the topological naming needs + TDF_Label findNamingName(std::string theName); + protected: //! Returns (creates if needed) the features label - TDF_Label featuresLabel(); + TDF_Label featuresLabel() const; //! Initializes feature with a unique name in this group (unique name is generated as //! feature type + "_" + index @@ -177,7 +184,7 @@ class Model_Document : public ModelAPI_Document void updateResults(FeaturePtr theFeature); //! Returns all sub documents - const std::set& subDocuments() const {return mySubs;} + const std::set subDocuments(const bool theActivatedOnly) const; friend class Model_Application; friend class Model_Session; @@ -198,9 +205,9 @@ class Model_Document : public ModelAPI_Document /// All features managed by this document (not only in history of OB) /// For optimization mapped by labels NCollection_DataMap myObjs; + /// Optimization for finding the shape-label by topological naming names + std::map myNamingNames; - ///< set of identifiers of sub-documents of this document - std::set mySubs; /// transaction indexes (related to myTransactionsAfterSave) which were empty in this doc std::map myIsEmptyTr; /// If it is true, features are not executed on update (on abort, undo, redo)