From db03bd31921ab90fc5bf3f8ed71dfe1af8147034 Mon Sep 17 00:00:00 2001 From: cg246364 Date: Mon, 9 Nov 2020 13:54:15 +0100 Subject: [PATCH] Prohibit the creation of volume when the associated group does not have a corresponding medium --- .../ExchangePlugin_ExportFeature.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp index 1734424ab..ee5cf6be4 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp @@ -638,10 +638,22 @@ void ExchangePlugin_ExportFeature::exportROOT(const std::string& theFileName) anAlgo->buildTranslation(anObjectName, aDx, aDy, aDz); aListNamesOfFeatures.push_back(anObjectName); aListNamesOfFeatures.push_back(aCurFeature->data()->name()); + } else if (aCurFeature->getKind() == "Partition") { + //std::cout<<"ToDo PARTITION"<firstResult()->data()->name(); + aListNamesOfFeatures.push_back(anObjectName); + aListNamesOfFeatures.push_back(aCurFeature->data()->name()); } } // Add all groups in the file + std::map >::const_iterator anIt = aMedium.begin(), + aLast = aMedium.end(); + std::vector aListMedium; + for (; anIt != aLast; anIt++) { + aListMedium.push_back(anIt->first); + } + itExport = theExport.begin(); for (; itExport != theExport.end(); ++itExport) { @@ -654,7 +666,7 @@ void ExchangePlugin_ExportFeature::exportROOT(const std::string& theFileName) //for (std::vector::iterator it = myvector.begin() ; it != myvector.end(); ++it) for (std::vector::iterator it = aListNames.begin(); it != aListNames.end(); it++) { std::string aName = anObjectName + "_" + *it; - anAlgo->BuildVolume(aName, *it, anObjectName); + anAlgo->BuildVolume(aName, *it, anObjectName, aListMedium); } } } -- 2.39.2