X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_Document.h;h=d82b853f65131b7c4bdb7a7c2a338e6fd50deb81;hb=dc19b4c930a9c2cf5db509fc81586deab00e7417;hp=bc414a15672e9d41f7cf7c7c3c4d4916bd8d829b;hpb=4af82842098757e6e7f4f28e2eb744d184bb2b3e;p=modules%2Fshaper.git diff --git a/src/Model/Model_Document.h b/src/Model/Model_Document.h index bc414a156..d82b853f6 100644 --- a/src/Model/Model_Document.h +++ b/src/Model/Model_Document.h @@ -19,6 +19,7 @@ class Handle_Model_Document; class Model_Objects; +class ModelAPI_AttributeSelectionList; /**\class Model_Document * \ingroup DataModel @@ -88,6 +89,9 @@ class Model_Document : public ModelAPI_Document //! \param theFeature a removed feature MODEL_EXPORT virtual void removeFeature(FeaturePtr theFeature); + //! Moves the feature to make it after the given one in the history. + MODEL_EXPORT virtual void moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis); + //! Returns the first found object in the group by the object name //! \param theGroupID group that contains an object //! \param theName name of the object to search @@ -106,7 +110,7 @@ class Model_Document : public ModelAPI_Document //! Internal sub-document by ID MODEL_EXPORT virtual std::shared_ptr subDoc(std::string theDocID); - ///! Returns the id of hte document + ///! Returns the id of the document MODEL_EXPORT virtual const std::string& id() const { return myID; @@ -136,6 +140,11 @@ class Model_Document : public ModelAPI_Document //! Makes the current feature one feature upper MODEL_EXPORT virtual void setCurrentFeatureUp(); + //! Returns the number of all features: in the history or not + MODEL_EXPORT virtual int numInternalFeatures(); + //! Returns the feature by zero-based index: features in the history or not + MODEL_EXPORT virtual std::shared_ptr internalFeature(const int theIndex); + /// Creates a construction cresults MODEL_EXPORT virtual std::shared_ptr createConstruction( const std::shared_ptr& theFeatureData, const int theIndex = 0); @@ -145,6 +154,10 @@ class Model_Document : public ModelAPI_Document /// Creates a part results MODEL_EXPORT virtual std::shared_ptr createPart( const std::shared_ptr& theFeatureData, const int theIndex = 0); + //! Copies a part result, keeping the reference to origin + MODEL_EXPORT virtual std::shared_ptr copyPart( + const std::shared_ptr& theOrigin, + const std::shared_ptr& theFeatureData, const int theIndex = 0); /// Creates a group results MODEL_EXPORT virtual std::shared_ptr createGroup( const std::shared_ptr& theFeatureData, const int theIndex = 0); @@ -172,6 +185,20 @@ class Model_Document : public ModelAPI_Document ///! history. Not very fast method, for calling once, not in big cycles. MODEL_EXPORT virtual std::list > allFeatures(); + /// Returns the global identifier of the current transaction (needed for the update algo) + MODEL_EXPORT virtual int transactionID(); + /// Increases the transaction ID + MODEL_EXPORT virtual void incrementTransactionID(); + /// Decreases the transaction ID + MODEL_EXPORT virtual void decrementTransactionID(); + + /// Returns true if document is opened and valid + MODEL_EXPORT virtual bool isOpened(); + + /// Returns the last feature in the document (even not visible or disabled) + /// \returns null if there is no features + FeaturePtr lastFeature(); + protected: //! Returns (creates if needed) the general label TDF_Label generalLabel() const; @@ -223,6 +250,9 @@ class Model_Document : public ModelAPI_Document //! Returns true if this document is currently active virtual bool isActive() const; + //! Returns the selection attribute that is used for calculation of selection externally from the document + std::shared_ptr selectionInPartFeature(); + friend class Model_Application; friend class Model_Session; friend class Model_Update; @@ -230,6 +260,7 @@ class Model_Document : public ModelAPI_Document friend class Model_AttributeRefAttr; friend class Model_AttributeRefList; friend class Model_ResultPart; + friend class Model_ResultCompSolid; friend class DFBrowser; private: @@ -265,6 +296,9 @@ class Model_Document : public ModelAPI_Document bool myExecuteFeatures; bool myIsActive; ///< flag that stores the active/not active state + + //! The selection feature, if needed + FeaturePtr mySelectionFeature; }; #endif