Salome HOME
Initial implementation of restoreByName selector method
[modules/shaper.git] / src / Model / Model_AttributeSelection.h
index b0c3034d663e2a6ffab73a7b55c4bc47e48f8d61..187115e518b3a101ad8d83cbceb5c2fa10007e88 100644 (file)
@@ -49,6 +49,8 @@ class Model_AttributeSelection : public ModelAPI_AttributeSelection,
   CenterType myTmpCenterType;
   /// Reference to the partent attribute, if any (to split selection compounds in issue 1799)
   Model_AttributeSelectionList* myParent;
+
+  std::shared_ptr<Model_Document> myRestoreDocument; // current document to restore by name
 public:
   /// Defines the result and its selected sub-shape
   /// \param theContext object where the sub-shape was selected
@@ -134,6 +136,11 @@ public:
   // This method returns the context name by the label of the sub-selected shape
   MODEL_EXPORT virtual std::string contextName(const TDF_Label theSelectionLab) override;
 
+  /// This method restores by the context and value name the context label and
+  /// sub-label where the value is. Returns true if it is valid.
+  MODEL_EXPORT virtual bool restoreContext(std::string theName,
+    TDF_Label& theContext, TDF_Label& theValue) override;
+
 protected:
   /// Objects are created for features automatically
   MODEL_EXPORT Model_AttributeSelection(TDF_Label& theLabel);