]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_Objects.cpp
Salome HOME
Compsolid result interface.
[modules/shaper.git] / src / Model / Model_Objects.cpp
index 72544d26ee8e83b0e73d13b1bd3699488dde37f9..bec8764981b61c836d663b56105a010969f0b36f 100644 (file)
@@ -12,6 +12,7 @@
 #include <Model_ResultPart.h>
 #include <Model_ResultConstruction.h>
 #include <Model_ResultBody.h>
+#include <Model_ResultCompSolid.h>
 #include <Model_ResultGroup.h>
 #include <Model_ResultParameter.h>
 #include <ModelAPI_Validator.h>
@@ -763,6 +764,23 @@ std::shared_ptr<ModelAPI_ResultBody> Model_Objects::createBody(
   return aResult;
 }
 
+std::shared_ptr<ModelAPI_ResultCompSolid> Model_Objects::createCompSolid(
+    const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex)
+{
+  TDF_Label aLab = resultLabel(theFeatureData, theIndex);
+  TDataStd_Comment::Set(aLab, ModelAPI_ResultCompSolid::group().c_str());
+  ObjectPtr anOldObject = object(aLab);
+  std::shared_ptr<ModelAPI_ResultCompSolid> aResult;
+  if (anOldObject) {
+    aResult = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(anOldObject);
+  }
+  if (!aResult) {
+    aResult = std::shared_ptr<ModelAPI_ResultCompSolid>(new Model_ResultCompSolid);
+    storeResult(theFeatureData, aResult, theIndex);
+  }
+  return aResult;
+}
+
 std::shared_ptr<ModelAPI_ResultPart> Model_Objects::createPart(
     const std::shared_ptr<ModelAPI_Data>& theFeatureData, const int theIndex)
 {