]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
feature addVolume working as Result nrn/opera/AddVolume
authorNicolas RECHATIN <nicolas.rechatin@cea.fr>
Tue, 27 Jul 2021 07:53:01 +0000 (09:53 +0200)
committerNicolas RECHATIN <nicolas.rechatin@cea.fr>
Tue, 27 Jul 2021 07:53:01 +0000 (09:53 +0200)
src/OperaPlugin/OperaPlugin_Volume.cpp

index e8e4c3a9afe8b3c1f4c0d99c957df8e168152595..6e11a9172b00824421469429aee6ae91b6e2e261 100644 (file)
@@ -24,6 +24,8 @@
 #include <ModelAPI_AttributeIntArray.h>
 #include <ModelAPI_Data.h>
 #include <ModelAPI_Document.h>
+
+#include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultVolume.h>
 #include <ModelAPI_Tools.h>
 
@@ -105,22 +107,22 @@ void OperaPlugin_Volume::execute()
     do {
       anInd++;
       std::wostringstream aNameStr;
-      aNameStr << "Volume_" << aBaseName << "_" << (aSelIndex + anInd);
+      aNameStr << "Volume_" << aBaseName;
       aName = aNameStr.str();
     } while (anExistingNames.count(aName));
     anExistingNames.insert(aName);
 
-    std::shared_ptr<ModelAPI_ResultVolume> aResultVolume = document()->createVolume(data(), aResultIndex);
+    std::shared_ptr<ModelAPI_ResultBody> aResultVolume = document()->createBody(data(), aResultIndex);
     aResultVolume->data()->setName(aName);
     // to make sub-results also names with a similar name temporarily rename the feature
     std::wstring anOrigName = name();
     data()->setName(aBaseName);
 
-    aResultVolume->store(aResult); //TODO : CRASH, works with BODY
+    aResultVolume->store(aResult); //TODO : CRASH, works with Volume
 
     data()->setName(anOrigName);
     aResultVolume->loadFirstLevel(aResult, "Copy");
-    setResult(aResultVolume, aResultIndex++);
+    setResult(aResultVolume, ++aResultIndex);
   }
   removeResults(aResultIndex);
 }