]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_Document.cpp
Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom.git into Dev_1.1.0
[modules/shaper.git] / src / Model / Model_Document.cpp
index d88015148a1b96f8a2cda6490f8e5ec74b13b7cf..71019bc6d50f4baa503565c0b455b7da4773e737 100644 (file)
@@ -15,6 +15,7 @@
 #include <Model_ResultGroup.h>
 #include <ModelAPI_Validator.h>
 #include <ModelAPI_CompositeFeature.h>
+
 #include <Events_Loop.h>
 #include <Events_Error.h>
 
@@ -1222,6 +1223,23 @@ std::shared_ptr<ModelAPI_ResultGroup> Model_Document::createGroup(
   return aResult;
 }
 
+std::shared_ptr<ModelAPI_ResultParameter> Model_Document::createParameter(
+      const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex)
+{
+  TDF_Label aLab = resultLabel(theFeatureData, theIndex);
+  TDataStd_Comment::Set(aLab, ModelAPI_ResultParameter::group().c_str());
+  ObjectPtr anOldObject = object(aLab);
+  std::shared_ptr<ModelAPI_ResultParameter> aResult;
+  if (anOldObject) {
+    aResult = std::dynamic_pointer_cast<ModelAPI_ResultParameter>(anOldObject);
+  }
+  if (!aResult) {
+    aResult = std::shared_ptr<ModelAPI_ResultParameter>(new ModelAPI_ResultParameter);
+    storeResult(theFeatureData, aResult, theIndex);
+  }
+  return aResult;
+}
+
 std::shared_ptr<ModelAPI_Feature> Model_Document::feature(
     const std::shared_ptr<ModelAPI_Result>& theResult)
 {