1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_Rotation.cpp
4 // Created: 07 June 2016
5 // Author: Dmitry Bobylev
7 #include "FeaturesAPI_Rotation.h"
9 #include <ModelHighAPI_Tools.h>
11 //==================================================================================================
12 FeaturesAPI_Rotation::FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature)
13 : ModelHighAPI_Interface(theFeature)
18 //==================================================================================================
19 FeaturesAPI_Rotation::FeaturesAPI_Rotation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
20 const std::list<ModelHighAPI_Selection>& theMainObjects,
21 const ModelHighAPI_Selection& theAxisObject,
22 const ModelHighAPI_Double& theAngle)
23 : ModelHighAPI_Interface(theFeature)
26 setMainObjects(theMainObjects);
27 setAxisObject(theAxisObject);
32 //==================================================================================================
33 FeaturesAPI_Rotation::~FeaturesAPI_Rotation()
38 //==================================================================================================
39 void FeaturesAPI_Rotation::setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects)
41 fillAttribute(theMainObjects, mymainObjects);
46 //==================================================================================================
47 void FeaturesAPI_Rotation::setAxisObject(const ModelHighAPI_Selection& theAxisObject)
49 fillAttribute(theAxisObject, myaxisObject);
54 //==================================================================================================
55 void FeaturesAPI_Rotation::setAngle(const ModelHighAPI_Double& theAngle)
57 fillAttribute(theAngle, myangle);
62 // TODO(spo): make add* as static functions of the class
63 //==================================================================================================
64 RotationPtr addRotation(const std::shared_ptr<ModelAPI_Document>& thePart,
65 const std::list<ModelHighAPI_Selection>& theMainObjects,
66 const ModelHighAPI_Selection& theAxisObject,
67 const ModelHighAPI_Double& theDistance)
69 std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(FeaturesAPI_Rotation::ID());
70 return RotationPtr(new FeaturesAPI_Rotation(aFeature, theMainObjects, theAxisObject, theDistance));