From: Nicolas RECHATIN Date: Tue, 27 Jul 2021 07:53:01 +0000 (+0200) Subject: feature addVolume working as Result X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fnrn%2Fopera%2FAddVolume;p=modules%2Fshaper.git feature addVolume working as Result --- diff --git a/src/OperaPlugin/OperaPlugin_Volume.cpp b/src/OperaPlugin/OperaPlugin_Volume.cpp index e8e4c3a9a..6e11a9172 100644 --- a/src/OperaPlugin/OperaPlugin_Volume.cpp +++ b/src/OperaPlugin/OperaPlugin_Volume.cpp @@ -24,6 +24,8 @@ #include #include #include + +#include #include #include @@ -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 aResultVolume = document()->createVolume(data(), aResultIndex); + std::shared_ptr 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); }