Salome HOME
Merge remote-tracking branch 'origin/cgt/devCEA'
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Translation.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        FeaturesAPI_Translation.h
4 // Created:     07 June 2016
5 // Author:      Dmitry Bobylev
6
7 #ifndef FeaturesAPI_Translation_H_
8 #define FeaturesAPI_Translation_H_
9
10 #include "FeaturesAPI.h"
11
12 #include <FeaturesPlugin_Translation.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Dumper;
19 class ModelHighAPI_Selection;
20
21 /// \class FeaturesAPI_Translation
22 /// \ingroup CPPHighAPI
23 /// \brief Interface for Translation feature.
24 class FeaturesAPI_Translation: public ModelHighAPI_Interface
25 {
26 public:
27   /// Constructor without values.
28   FEATURESAPI_EXPORT
29   explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30
31   /// Constructor with values.
32   FEATURESAPI_EXPORT
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);
37
38   /// Constructor with values.
39   FEATURESAPI_EXPORT
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);
45
46   /// Constructor with values.
47   FEATURESAPI_EXPORT
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);
52
53   /// Destructor.
54   FEATURESAPI_EXPORT
55   virtual ~FeaturesAPI_Translation();
56
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 */
76              )
77
78   /// Set main objects.
79   FEATURESAPI_EXPORT
80   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
81
82   /// Modify CreationMethod, axis_object, distance attributes of the feature.
83   FEATURESAPI_EXPORT
84   void setAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
85                           const ModelHighAPI_Double& theDistance);
86
87   /// Modify CreationMethod, dx, dy, dz attributes of the feature.
88   FEATURESAPI_EXPORT
89   void setDimensions(const ModelHighAPI_Double& theDx,
90                      const ModelHighAPI_Double& theDy,
91                      const ModelHighAPI_Double& theDz);
92
93   /// Modify CreationMethod, start_point, end_point attributes of the feature.
94   FEATURESAPI_EXPORT
95   void setPoints(const ModelHighAPI_Selection& theStartPoint,
96                  const ModelHighAPI_Selection& theEndPoint);
97
98   /// Dump wrapped feature
99   FEATURESAPI_EXPORT
100   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
101 };
102
103 /// Pointer on Translation object.
104 typedef std::shared_ptr<FeaturesAPI_Translation> TranslationPtr;
105
106 /// \ingroup CPPHighAPI
107 /// \brief Create Translation feature.
108 FEATURESAPI_EXPORT
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);
113
114 /// \ingroup CPPHighAPI
115 /// \brief Create Translation feature.
116 FEATURESAPI_EXPORT
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);
122
123 /// \ingroup CPPHighAPI
124 /// \brief Create Translation feature.
125 FEATURESAPI_EXPORT
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);
130
131 #endif // FeaturesAPI_Translation_H_