X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Partition.cpp;h=66a64ba435017e15ef2fa1c3853a286f408c3b40;hb=85b662214060cf733b44ac7822e3e4db49e2da4b;hp=e7e74c68e91a6d69aab4e473bb11793e084df74c;hpb=87ac65e82ce1ebcb027da959517b1654ce2b5076;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp index e7e74c68e..66a64ba43 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Partition.cpp @@ -93,7 +93,7 @@ void FeaturesPlugin_Partition::execute() bool isCombine = boolean(COMBINE_ID())->value(); if(anObjects.empty()/* || aTools.empty()*/) { - std::string aFeatureError = "Not enough objects for partition operation"; + std::string aFeatureError = "Error: Not enough objects for partition operation."; setError(aFeatureError); return; } @@ -102,27 +102,27 @@ void FeaturesPlugin_Partition::execute() if(isCombine) { // Create single result. - if(!aTools.empty()) { - // This is a workaround for naming. Passing compound of objects as argument instead each object separately. - std::shared_ptr aCompoud = GeomAlgoAPI_CompoundBuilder::compound(anObjects); - anObjects.clear(); - anObjects.push_back(aCompoud); - } + //if(!aTools.empty()) { + // // This is a workaround for naming. Passing compound of objects as argument instead each object separately. + // std::shared_ptr aCompoud = GeomAlgoAPI_CompoundBuilder::compound(anObjects); + // anObjects.clear(); + // anObjects.push_back(aCompoud); + //} std::shared_ptr aPartitionAlgo(new GeomAlgoAPI_Partition(anObjects, aTools)); // Checking that the algorithm worked properly. if (!aPartitionAlgo->isDone()) { - static const std::string aFeatureError = "Partition algorithm failed"; + static const std::string aFeatureError = "Error: Partition algorithm failed."; setError(aFeatureError); return; } if (aPartitionAlgo->shape()->isNull()) { - static const std::string aShapeError = "Resulting shape is Null"; + static const std::string aShapeError = "Error: Resulting shape is Null."; setError(aShapeError); return; } if (!aPartitionAlgo->isValid()) { - std::string aFeatureError = "Warning: resulting shape is not valid"; + std::string aFeatureError = "Error: Resulting shape is not valid."; setError(aFeatureError); return; } @@ -131,7 +131,10 @@ void FeaturesPlugin_Partition::execute() std::shared_ptr aResultBody = document()->createBody(data(), aResultIndex); aMakeShapeList.appendAlgo(aPartitionAlgo); GeomAPI_DataMapOfShapeShape& aMapOfShapes = *aPartitionAlgo->mapOfSubShapes().get(); - loadNamingDS(aResultBody, anObjects.front(), aToolsForNaming, aPartitionAlgo->shape(), aMakeShapeList, aMapOfShapes); + std::shared_ptr aBaseShape = anObjects.front(); + anObjects.pop_front(); + aToolsForNaming.insert(aToolsForNaming.end(), anObjects.begin(), anObjects.end()); + loadNamingDS(aResultBody, aBaseShape, aToolsForNaming, aPartitionAlgo->shape(), aMakeShapeList, aMapOfShapes); setResult(aResultBody, aResultIndex); aResultIndex++; } @@ -144,17 +147,17 @@ void FeaturesPlugin_Partition::execute() // Checking that the algorithm worked properly. if (!aPartitionAlgo->isDone()) { - static const std::string aFeatureError = "Partition algorithm failed"; + static const std::string aFeatureError = "Error: Partition algorithm failed."; setError(aFeatureError); return; } if (aPartitionAlgo->shape()->isNull()) { - static const std::string aShapeError = "Resulting shape is Null"; + static const std::string aShapeError = "Error: Resulting shape is Null."; setError(aShapeError); return; } if (!aPartitionAlgo->isValid()) { - std::string aFeatureError = "Warning: resulting shape is not valid"; + std::string aFeatureError = "Error: Resulting shape is not valid."; setError(aFeatureError); return; }