Salome HOME
Merge branch 'master' into 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   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   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   /// Destructor.
47   FEATURESAPI_EXPORT
48   virtual ~FeaturesAPI_Translation();
49
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 */
65              )
66
67   /// Set main objects.
68   FEATURESAPI_EXPORT
69   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
70
71   /// Modify CreationMethod, axis_object, distance attributes of the feature.
72   FEATURESAPI_EXPORT
73   void setAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
74                           const ModelHighAPI_Double& theDistance);
75
76   /// Modify CreationMethod, dx, dy, dz attributes of the feature.
77   FEATURESAPI_EXPORT
78   void setDimensions(const ModelHighAPI_Double& theDx,
79                      const ModelHighAPI_Double& theDy,
80                      const ModelHighAPI_Double& theDz);
81
82   /// Dump wrapped feature
83   FEATURESAPI_EXPORT
84   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
85 };
86
87 /// Pointer on Translation object.
88 typedef std::shared_ptr<FeaturesAPI_Translation> TranslationPtr;
89
90 /// \ingroup CPPHighAPI
91 /// \brief Create Translation feature.
92 FEATURESAPI_EXPORT
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);
97
98 /// \ingroup CPPHighAPI
99 /// \brief Create Translation feature.
100 FEATURESAPI_EXPORT
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);
106
107 #endif // FeaturesAPI_Translation_H_