X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesAPI%2FFeaturesAPI_MultiTranslation.cpp;fp=src%2FFeaturesAPI%2FFeaturesAPI_MultiTranslation.cpp;h=9885ed33e5e494df567c3845262942ddbca840b0;hb=6501b9ab5d3c4d76af5e7628582a7716f8354cd7;hp=c5afd844478eb078400a8331a9c188296cde8370;hpb=68cdca74771f85658ce633f1e2504f0c741ab078;p=modules%2Fshaper.git diff --git a/src/FeaturesAPI/FeaturesAPI_MultiTranslation.cpp b/src/FeaturesAPI/FeaturesAPI_MultiTranslation.cpp index c5afd8444..9885ed33e 100644 --- a/src/FeaturesAPI/FeaturesAPI_MultiTranslation.cpp +++ b/src/FeaturesAPI/FeaturesAPI_MultiTranslation.cpp @@ -155,20 +155,10 @@ void FeaturesAPI_MultiTranslation::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", " << anAttrSecondNumber; } - theDumper << ")" << std::endl; -} + if (!aBase->data()->version().empty()) + theDumper << ", keepSubResults = True"; -//================================================================================================== -MultiTranslationPtr addMultiTranslation(const std::shared_ptr& thePart, - const std::list& theMainObjects, - const ModelHighAPI_Selection& theAxisObject, - const ModelHighAPI_Double& theStep, - const ModelHighAPI_Integer& theNumber) -{ - std::shared_ptr aFeature = - thePart->addFeature(FeaturesAPI_MultiTranslation::ID()); - return MultiTranslationPtr(new FeaturesAPI_MultiTranslation(aFeature, theMainObjects, - theAxisObject, theStep, theNumber)); + theDumper << ")" << std::endl; } //================================================================================================== @@ -179,13 +169,22 @@ MultiTranslationPtr addMultiTranslation(const std::shared_ptr const ModelHighAPI_Integer& theFirstNumber, const ModelHighAPI_Selection& theSecondAxisObject, const ModelHighAPI_Double& theSecondStep, - const ModelHighAPI_Integer& theSecondNumber) + const ModelHighAPI_Integer& theSecondNumber, + const bool keepSubResults) { std::shared_ptr aFeature = thePart->addFeature(FeaturesAPI_MultiTranslation::ID()); - return MultiTranslationPtr(new FeaturesAPI_MultiTranslation(aFeature, theMainObjects, - theFirstAxisObject, theFirstStep, - theFirstNumber, - theSecondAxisObject, theSecondStep, - theSecondNumber)); + if (!keepSubResults) + aFeature->data()->setVersion(""); + MultiTranslationPtr aMT; + if (theSecondAxisObject.variantType() == ModelHighAPI_Selection::VT_Empty) { + aMT.reset(new FeaturesAPI_MultiTranslation(aFeature, theMainObjects, + theFirstAxisObject, theFirstStep, theFirstNumber)); + } + else { + aMT.reset(new FeaturesAPI_MultiTranslation(aFeature, theMainObjects, + theFirstAxisObject, theFirstStep, theFirstNumber, + theSecondAxisObject, theSecondStep, theSecondNumber)); + } + return aMT; }