Salome HOME
Issue #1662: implementation of Recover feature.
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Tools.cpp
index fb1df5c4c4d14639fa679a78c0700898e518c572..be4e0186f020be400cbafd5d67dee676583dcb72 100644 (file)
@@ -31,6 +31,7 @@
 #include "ModelHighAPI_Double.h"
 #include "ModelHighAPI_Integer.h"
 #include "ModelHighAPI_RefAttr.h"
+#include "ModelHighAPI_Reference.h"
 #include "ModelHighAPI_Selection.h"
 
 #include <algorithm>
@@ -104,6 +105,22 @@ void fillAttribute(const std::list<ModelHighAPI_RefAttr> & theValue,
     it->appendToList(theAttribute);
 }
 
+//--------------------------------------------------------------------------------------
+void fillAttribute(const ModelHighAPI_Reference & theValue,
+                   const std::shared_ptr<ModelAPI_AttributeReference> & theAttribute)
+{
+  theValue.fillAttribute(theAttribute);
+}
+
+//--------------------------------------------------------------------------------------
+void fillAttribute(const std::list<ModelHighAPI_Reference> & theValue,
+                   const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute)
+{
+  theAttribute->clear();
+  for (auto it = theValue.begin(); it != theValue.end(); ++it)
+    it->appendToList(theAttribute);
+}
+
 //--------------------------------------------------------------------------------------
 void fillAttribute(const std::shared_ptr<ModelAPI_Object> & theValue,
                    const std::shared_ptr<ModelAPI_AttributeReference> & theAttribute)
@@ -120,6 +137,15 @@ void fillAttribute(const std::list<std::shared_ptr<ModelAPI_Object> > & theValue
     theAttribute->append(*it);
 }
 
+MODELHIGHAPI_EXPORT
+void fillAttribute(const std::list<ModelHighAPI_Selection> & theValue,
+                   const std::shared_ptr<ModelAPI_AttributeRefList> & theAttribute)
+{
+  theAttribute->clear();
+  for (auto it = theValue.begin(); it != theValue.end(); ++it)
+    theAttribute->append(it->resultSubShapePair().first); // use only context
+}
+
 //--------------------------------------------------------------------------------------
 void fillAttribute(const ModelHighAPI_Selection & theValue,
                    const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute)