1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_Translation.cpp
4 // Created: 07 June 2016
5 // Author: Dmitry Bobylev
7 #include "FeaturesAPI_Translation.h"
9 #include <ModelHighAPI_Tools.h>
11 //==================================================================================================
12 FeaturesAPI_Translation::FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature)
13 : ModelHighAPI_Interface(theFeature)
18 //==================================================================================================
19 FeaturesAPI_Translation::FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
20 const std::list<ModelHighAPI_Selection>& theMainObjects,
21 const ModelHighAPI_Selection& theAxisObject,
22 const ModelHighAPI_Double& theDistance)
23 : ModelHighAPI_Interface(theFeature)
26 fillAttribute(theMainObjects, mymainObjects);
27 fillAttribute(theAxisObject, myaxisObject);
28 setDistance(theDistance);
32 //==================================================================================================
33 FeaturesAPI_Translation::~FeaturesAPI_Translation()
38 //==================================================================================================
39 void FeaturesAPI_Translation::setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects)
41 fillAttribute(theMainObjects, mymainObjects);
46 //==================================================================================================
47 void FeaturesAPI_Translation::setAxisObject(const ModelHighAPI_Selection& theAxisObject)
49 fillAttribute(theAxisObject, myaxisObject);
54 //==================================================================================================
55 void FeaturesAPI_Translation::setDistance(const ModelHighAPI_Double& theDistance)
57 fillAttribute(theDistance, mydistance);
62 //==================================================================================================
63 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
64 const std::list<ModelHighAPI_Selection>& theMainObjects,
65 const ModelHighAPI_Selection& theAxisObject,
66 const ModelHighAPI_Double& theDistance)
68 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Translation::ID());
69 return TranslationPtr(new FeaturesAPI_Translation(aFeature, theMainObjects, theAxisObject, theDistance));