-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include <FeaturesAPI_MultiTranslation.h>
theDumper << ", " << anAttrSecondNumber;
}
- theDumper << ")" << std::endl;
-}
+ if (!aBase->data()->version().empty())
+ theDumper << ", keepSubResults = True";
-//==================================================================================================
-MultiTranslationPtr addMultiTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
- const std::list<ModelHighAPI_Selection>& theMainObjects,
- const ModelHighAPI_Selection& theAxisObject,
- const ModelHighAPI_Double& theStep,
- const ModelHighAPI_Integer& theNumber)
-{
- std::shared_ptr<ModelAPI_Feature> aFeature =
- thePart->addFeature(FeaturesAPI_MultiTranslation::ID());
- return MultiTranslationPtr(new FeaturesAPI_MultiTranslation(aFeature, theMainObjects,
- theAxisObject, theStep, theNumber));
+ theDumper << ")" << std::endl;
}
//==================================================================================================
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<ModelAPI_Feature> 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;
}