Salome HOME
Issue #2626: Do not use non-initialized attribute for default value definition
[modules/shaper.git] / src / ModelAPI / ModelAPI_Document.h
index dc4160da4041ccbfde7cce899eb446d006c8485f..be23056ae6cae47231bd735fdae8a451234b2757 100644 (file)
@@ -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<ModelAPI_Object> parent(
+    const std::shared_ptr<ModelAPI_Object> 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<ModelAPI_Folder> findFolderBelow(
       const std::list<std::shared_ptr<ModelAPI_Feature> >& 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<ModelAPI_Folder> findContainingFolder(
+      const std::shared_ptr<ModelAPI_Feature>& 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