X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Translation.cpp;h=c3931387cf2de04422574dc778d6052237958fc7;hb=01a8a031b214d727e075a90ccdba0667a24db853;hp=c55d23d818391355b24abc3609adda4dec98f075;hpb=88df92abc27770d90e2470ab9912b237a56956db;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp index c55d23d81..c3931387c 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp @@ -89,27 +89,27 @@ void FeaturesPlugin_Translation::execute() aResultPart->setTrsf(*aContext, aTrsf); setResult(aResultPart); } else { - GeomAlgoAPI_Translation aMovementAlgo(aBaseShape, anAxis, aDistance); + GeomAlgoAPI_Translation aTranslationAlgo(aBaseShape, anAxis, aDistance); // Checking that the algorithm worked properly. - if(!aMovementAlgo.isDone()) { - static const std::string aFeatureError = "Movement algorithm failed"; + if(!aTranslationAlgo.isDone()) { + static const std::string aFeatureError = "Error: Translation algorithm failed."; setError(aFeatureError); break; } - if(aMovementAlgo.shape()->isNull()) { - static const std::string aShapeError = "Resulting shape is Null"; + if(aTranslationAlgo.shape()->isNull()) { + static const std::string aShapeError = "Error: Resulting shape is Null."; setError(aShapeError); break; } - if(!aMovementAlgo.isValid()) { - std::string aFeatureError = "Warning: resulting shape is not valid"; + if(!aTranslationAlgo.isValid()) { + std::string aFeatureError = "Error: Resulting shape is not valid."; setError(aFeatureError); break; } ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex); - LoadNamingDS(aMovementAlgo, aResultBody, aBaseShape); + loadNamingDS(aTranslationAlgo, aResultBody, aBaseShape); setResult(aResultBody, aResultIndex); } aResultIndex++; @@ -119,19 +119,19 @@ void FeaturesPlugin_Translation::execute() removeResults(aResultIndex); } -void FeaturesPlugin_Translation::LoadNamingDS(const GeomAlgoAPI_Translation& theMovementAlgo, - std::shared_ptr theResultBody, - std::shared_ptr theBaseShape) +void FeaturesPlugin_Translation::loadNamingDS(GeomAlgoAPI_Translation& theTranslationAlgo, + std::shared_ptr theResultBody, + std::shared_ptr theBaseShape) { // Store result. - theResultBody->storeModified(theBaseShape, theMovementAlgo.shape()); + theResultBody->storeModified(theBaseShape, theTranslationAlgo.shape()); - std::shared_ptr aSubShapes = theMovementAlgo.mapOfShapes(); + std::shared_ptr aSubShapes = theTranslationAlgo.mapOfSubShapes(); - int aMovedTag = 1; - std::string aMovedName = "Moved"; - theResultBody->loadAndOrientModifiedShapes(theMovementAlgo.makeShape().get(), - theBaseShape, GeomAPI_Shape::FACE, - aMovedTag, aMovedName, *aSubShapes.get()); + int aTranslatedTag = 1; + std::string aTranslatedName = "Translated"; + theResultBody->loadAndOrientModifiedShapes(&theTranslationAlgo, + theBaseShape, GeomAPI_Shape::FACE, + aTranslatedTag, aTranslatedName, *aSubShapes.get()); }