X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Document.h;h=be23056ae6cae47231bd735fdae8a451234b2757;hb=4830a0f80bd3b0ec58bc43cdbba0418f169952a9;hp=dc4160da4041ccbfde7cce899eb446d006c8485f;hpb=c5c451ec3d7b112e169d0e82dd5b7e8f8f05e16a;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Document.h b/src/ModelAPI/ModelAPI_Document.h index dc4160da4..be23056ae 100644 --- a/src/ModelAPI/ModelAPI_Document.h +++ b/src/ModelAPI/ModelAPI_Document.h @@ -114,6 +114,11 @@ public: //! \param theAllowFolder take into account grouping feature by folders virtual int size(const std::string& theGroupID, const bool theAllowFolder = false) = 0; + //! Returns the parent object of this child. This may be result or feature, parent of a + //! top result. Fast method, that uses internal data structure specifics. + virtual std::shared_ptr parent( + const std::shared_ptr theChild) = 0; + //! Returns the feature that is currently edited in this document, normally //! this is the latest created feature //! \param theVisible use visible features only: flag is true for Object Browser functionality @@ -198,6 +203,14 @@ public: //! \return Empty pointer if there is no applicable folder virtual std::shared_ptr findFolderBelow( const std::list >& theFeatures) = 0; + //! Search a folder containing the given feature. + //! Addtionally calculates a zero-based index of the feature in this folder. + //! \param theFeature feature to search + //! \param theIndexInFolder zero-based index in the folder or -1 if the feature is top-level. + //! \return the folder containing the feature or empty pointer if the feature is top-level. + virtual std::shared_ptr findContainingFolder( + const std::shared_ptr& theFeature, + int& theIndexInFolder) = 0; //! Add a list of features to the folder. The correctness of the adding is not performed //! (such checks have been done in corresponding find.. method). //! \return \c true if the movement is successfull