Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / FeaturesAPI / FeaturesAPI_Translation.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef FeaturesAPI_Translation_H_
22 #define FeaturesAPI_Translation_H_
23
24 #include "FeaturesAPI.h"
25
26 #include <FeaturesPlugin_Translation.h>
27
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Dumper;
33 class ModelHighAPI_Selection;
34
35 /// \class FeaturesAPI_Translation
36 /// \ingroup CPPHighAPI
37 /// \brief Interface for Translation feature.
38 class FeaturesAPI_Translation: public ModelHighAPI_Interface
39 {
40 public:
41   /// Constructor without values.
42   FEATURESAPI_EXPORT
43   explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44
45   /// Constructor with values.
46   FEATURESAPI_EXPORT
47   explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48                                    const std::list<ModelHighAPI_Selection>& theMainObjects,
49                                    const ModelHighAPI_Selection& theAxisObject,
50                                    const ModelHighAPI_Double& theDistance);
51
52   /// Constructor with values.
53   FEATURESAPI_EXPORT
54   explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55                                    const std::list<ModelHighAPI_Selection>& theMainObjects,
56                                    const ModelHighAPI_Double& theDx,
57                                    const ModelHighAPI_Double& theDy,
58                                    const ModelHighAPI_Double& theDz);
59
60   /// Constructor with values.
61   FEATURESAPI_EXPORT
62   explicit FeaturesAPI_Translation(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63                                    const std::list<ModelHighAPI_Selection>& theMainObjects,
64                                    const ModelHighAPI_Selection& theStartPoint,
65                                    const ModelHighAPI_Selection& theEndPoint);
66
67   /// Destructor.
68   FEATURESAPI_EXPORT
69   virtual ~FeaturesAPI_Translation();
70
71   INTERFACE_9(FeaturesPlugin_Translation::ID(),
72               creationMethod, FeaturesPlugin_Translation::CREATION_METHOD(),
73               ModelAPI_AttributeString, /** Creation method */,
74               mainObjects, FeaturesPlugin_Translation::OBJECTS_LIST_ID(),
75               ModelAPI_AttributeSelectionList, /** Main objects */,
76               axisObject, FeaturesPlugin_Translation::AXIS_OBJECT_ID(),
77               ModelAPI_AttributeSelection, /** Axis object */,
78               distance, FeaturesPlugin_Translation::DISTANCE_ID(),
79               ModelAPI_AttributeDouble, /** Distance */,
80               dx, FeaturesPlugin_Translation::DX_ID(),
81               ModelAPI_AttributeDouble, /** Dimension in X */,
82               dy, FeaturesPlugin_Translation::DY_ID(),
83               ModelAPI_AttributeDouble, /** Dimension in Y */,
84               dz, FeaturesPlugin_Translation::DZ_ID(),
85               ModelAPI_AttributeDouble, /** Dimension in Z */,
86               startPoint, FeaturesPlugin_Translation::START_POINT_ID(),
87               ModelAPI_AttributeSelection, /** Start point object */,
88               endPoint, FeaturesPlugin_Translation::END_POINT_ID(),
89               ModelAPI_AttributeSelection, /** End point object */
90              )
91
92   /// Set main objects.
93   FEATURESAPI_EXPORT
94   void setMainObjects(const std::list<ModelHighAPI_Selection>& theMainObjects);
95
96   /// Modify CreationMethod, axis_object, distance attributes of the feature.
97   FEATURESAPI_EXPORT
98   void setAxisAndDistance(const ModelHighAPI_Selection& theAxisObject,
99                           const ModelHighAPI_Double& theDistance);
100
101   /// Modify CreationMethod, dx, dy, dz attributes of the feature.
102   FEATURESAPI_EXPORT
103   void setDimensions(const ModelHighAPI_Double& theDx,
104                      const ModelHighAPI_Double& theDy,
105                      const ModelHighAPI_Double& theDz);
106
107   /// Modify CreationMethod, start_point, end_point attributes of the feature.
108   FEATURESAPI_EXPORT
109   void setPoints(const ModelHighAPI_Selection& theStartPoint,
110                  const ModelHighAPI_Selection& theEndPoint);
111
112   /// Dump wrapped feature
113   FEATURESAPI_EXPORT
114   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
115 };
116
117 /// Pointer on Translation object.
118 typedef std::shared_ptr<FeaturesAPI_Translation> TranslationPtr;
119
120 /// \ingroup CPPHighAPI
121 /// \brief Create Translation feature.
122 FEATURESAPI_EXPORT
123 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
124                               const std::list<ModelHighAPI_Selection>& theMainObjects,
125                               const ModelHighAPI_Selection& theAxisObject,
126                               const ModelHighAPI_Double& theDistance);
127
128 /// \ingroup CPPHighAPI
129 /// \brief Create Translation feature.
130 FEATURESAPI_EXPORT
131 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
132                               const std::list<ModelHighAPI_Selection>& theMainObjects,
133                               const ModelHighAPI_Double& theDx,
134                               const ModelHighAPI_Double& theDy,
135                               const ModelHighAPI_Double& theDz);
136
137 /// \ingroup CPPHighAPI
138 /// \brief Create Translation feature.
139 FEATURESAPI_EXPORT
140 TranslationPtr addTranslation(const std::shared_ptr<ModelAPI_Document>& thePart,
141                               const std::list<ModelHighAPI_Selection>& theMainObjects,
142                               const ModelHighAPI_Selection& theStartPoint,
143                               const ModelHighAPI_Selection& theEndPoint);
144
145 #endif // FeaturesAPI_Translation_H_