1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesAPI_Translation.h
4 // Created: 07 June 2016
5 // Author: Dmitry Bobylev
7 #ifndef FeaturesAPI_Translation_H_
8 #define FeaturesAPI_Translation_H_
10 #include "FeaturesAPI.h"
12 #include <FeaturesPlugin_Translation.h>
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Dumper;
19 class ModelHighAPI_Selection;
21 /// \class FeaturesAPI_Translation
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Translation feature.
24 class FeaturesAPI_Translation: public ModelHighAPI_Interface
27 /// Constructor without values.
29 explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
31 /// Constructor with values.
33 explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
34 const std::list<ModelHighAPI_Selection>& theMainObjects,
35 const ModelHighAPI_Selection& theAxisObject,
36 const ModelHighAPI_Double& theDistance);
38 /// Constructor with values.
40 explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
41 const std::list<ModelHighAPI_Selection>& theMainObjects,
42 const ModelHighAPI_Double& theDx,
43 const ModelHighAPI_Double& theDy,
44 const ModelHighAPI_Double& theDz);
46 /// Constructor with values.
48 explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
49 const std::list<ModelHighAPI_Selection>& theMainObjects,
50 const ModelHighAPI_Selection& theStartPoint,
51 const ModelHighAPI_Selection& theEndPoint);
55 virtual ~FeaturesAPI_Translation();
57 INTERFACE_9(FeaturesPlugin_Translation::ID(),
58 creationMethod, FeaturesPlugin_Translation::CREATION_METHOD(),
59 ModelAPI_AttributeString, /** Creation method */,
60 mainObjects, FeaturesPlugin_Translation::OBJECTS_LIST_ID(),
61 ModelAPI_AttributeSelectionList, /** Main objects */,
62 axisObject, FeaturesPlugin_Translation::AXIS_OBJECT_ID(),
63 ModelAPI_AttributeSelection, /** Axis object */,
64 distance, FeaturesPlugin_Translation::DISTANCE_ID(),
65 ModelAPI_AttributeDouble, /** Distance */,
66 dx, FeaturesPlugin_Translation::DX_ID(),
67 ModelAPI_AttributeDouble, /** Dimension in X */,
68 dy, FeaturesPlugin_Translation::DY_ID(),
69 ModelAPI_AttributeDouble, /** Dimension in Y */,
70 dz, FeaturesPlugin_Translation::DZ_ID(),
71 ModelAPI_AttributeDouble, /** Dimension in Z */,
72 startPoint, FeaturesPlugin_Translation::START_POINT_ID(),
73 ModelAPI_AttributeSelection, /** Start point object */,
74 endPoint, FeaturesPlugin_Translation::END_POINT_ID(),
75 ModelAPI_AttributeSelection, /** End point object */
80 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
82 /// Modify CreationMethod, axis_object, distance attributes of the feature.
84 void setAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
85 const ModelHighAPI_Double& theDistance);
87 /// Modify CreationMethod, dx, dy, dz attributes of the feature.
89 void setDimensions(const ModelHighAPI_Double& theDx,
90 const ModelHighAPI_Double& theDy,
91 const ModelHighAPI_Double& theDz);
93 /// Modify CreationMethod, start_point, end_point attributes of the feature.
95 void setPoints(const ModelHighAPI_Selection& theStartPoint,
96 const ModelHighAPI_Selection& theEndPoint);
98 /// Dump wrapped feature
100 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
103 /// Pointer on Translation object.
104 typedef std::shared_ptr<FeaturesAPI_Translation> TranslationPtr;
106 /// \ingroup CPPHighAPI
107 /// \brief Create Translation feature.
109 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
110 const std::list<ModelHighAPI_Selection>& theMainObjects,
111 const ModelHighAPI_Selection& theAxisObject,
112 const ModelHighAPI_Double& theDistance);
114 /// \ingroup CPPHighAPI
115 /// \brief Create Translation feature.
117 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
118 const std::list<ModelHighAPI_Selection>& theMainObjects,
119 const ModelHighAPI_Double& theDx,
120 const ModelHighAPI_Double& theDy,
121 const ModelHighAPI_Double& theDz);
123 /// \ingroup CPPHighAPI
124 /// \brief Create Translation feature.
126 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
127 const std::list<ModelHighAPI_Selection>& theMainObjects,
128 const ModelHighAPI_Selection& theStartPoint,
129 const ModelHighAPI_Selection& theEndPoint);
131 #endif // FeaturesAPI_Translation_H_