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 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 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);
48 virtual ~FeaturesAPI_Translation();
50 INTERFACE_7(FeaturesPlugin_Translation::ID(),
51 creationMethod, FeaturesPlugin_Translation::CREATION_METHOD(),
52 ModelAPI_AttributeString, /** Creation method */,
53 mainObjects, FeaturesPlugin_Translation::OBJECTS_LIST_ID(),
54 ModelAPI_AttributeSelectionList, /** Main objects */,
55 axisObject, FeaturesPlugin_Translation::AXIS_OBJECT_ID(),
56 ModelAPI_AttributeSelection, /** Axis object */,
57 distance, FeaturesPlugin_Translation::DISTANCE_ID(),
58 ModelAPI_AttributeDouble, /** Distance */,
59 dx, FeaturesPlugin_Translation::DX_ID(),
60 ModelAPI_AttributeDouble, /** Dimension in X */,
61 dy, FeaturesPlugin_Translation::DY_ID(),
62 ModelAPI_AttributeDouble, /** Dimension in Y */,
63 dz, FeaturesPlugin_Translation::DZ_ID(),
64 ModelAPI_AttributeDouble, /** Dimension in Z */
69 void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
71 /// Modify CreationMethod, axis_object, distance attributes of the feature.
73 void setAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
74 const ModelHighAPI_Double& theDistance);
76 /// Modify CreationMethod, dx, dy, dz attributes of the feature.
78 void setDimensions(const ModelHighAPI_Double& theDx,
79 const ModelHighAPI_Double& theDy,
80 const ModelHighAPI_Double& theDz);
82 /// Dump wrapped feature
84 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
87 /// Pointer on Translation object.
88 typedef std::shared_ptr<FeaturesAPI_Translation> TranslationPtr;
90 /// \ingroup CPPHighAPI
91 /// \brief Create Translation feature.
93 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
94 const std::list<ModelHighAPI_Selection>& theMainObjects,
95 const ModelHighAPI_Selection& theAxisObject,
96 const ModelHighAPI_Double& theDistance);
98 /// \ingroup CPPHighAPI
99 /// \brief Create Translation feature.
101 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
102 const std::list<ModelHighAPI_Selection>& theMainObjects,
103 const ModelHighAPI_Double& theDx,
104 const ModelHighAPI_Double& theDy,
105 const ModelHighAPI_Double& theDz);
107 #endif // FeaturesAPI_Translation_H_