Salome HOME
Issue #1650: Added CPP High API for feature Axis;
[modules/shaper.git] / src / ConstructionAPI / ConstructionAPI_Axis.h
1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
2
3 // Name   : ConstructionAPI_Axis.h
4 // Purpose: 
5 //
6 // History:
7 // 15/06/16 - Sergey POKHODENKO - Creation of the file
8 // 24/06/16 - Clarisse GENRAULT (CEA) - Modification of the file
9
10 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
11 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
12
13 #include "ConstructionAPI.h"
14
15 #include <ConstructionPlugin_Axis.h>
16
17 #include <ModelHighAPI_Interface.h>
18 #include <ModelHighAPI_Macro.h>
19
20 class ModelHighAPI_Double;
21 class ModelHighAPI_Selection;
22
23 /// \class ConstructionAPI_Axis
24 /// \ingroup CPPHighAPI
25 /// \brief Interface for Axis feature
26 class ConstructionAPI_Axis: public ModelHighAPI_Interface
27 {
28 public:
29   /// Constructor without values
30   CONSTRUCTIONAPI_EXPORT
31   explicit ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature);
32
33   /// Constructor with values
34   CONSTRUCTIONAPI_EXPORT
35   ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
36                        const ModelHighAPI_Selection& theObject1,
37                        const ModelHighAPI_Selection& theObject2);
38
39   /// Constructor with values
40   CONSTRUCTIONAPI_EXPORT
41   ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
42                        const ModelHighAPI_Selection& theObject);
43
44   /// Constructor with values
45   CONSTRUCTIONAPI_EXPORT
46   ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47                        const ModelHighAPI_Selection& thePoint,
48                        const ModelHighAPI_Double& theX,
49                        const ModelHighAPI_Double& theY,
50                        const ModelHighAPI_Double& theZ);
51
52   /// Constructor with values
53   CONSTRUCTIONAPI_EXPORT
54   ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55                        const ModelHighAPI_Double& theDX,
56                        const ModelHighAPI_Double& theDY,
57                        const ModelHighAPI_Double& theDZ);
58
59   /// Constructor with values
60   CONSTRUCTIONAPI_EXPORT
61   ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62                        const ModelHighAPI_Selection& thePlane1,
63                        const ModelHighAPI_Double& theOffset1,
64                        const bool theReverseOffset1,
65                        const ModelHighAPI_Selection& thePlane2,
66                        const ModelHighAPI_Double& theOffset2,
67                        const bool theReverseOffset2);
68
69   /// Destructor
70   CONSTRUCTIONAPI_EXPORT
71   virtual ~ConstructionAPI_Axis();
72
73   INTERFACE_21(ConstructionPlugin_Axis::ID(),
74                creationMethod, ConstructionPlugin_Axis::METHOD(), ModelAPI_AttributeString, /** Creation method */,
75                firstPoint, ConstructionPlugin_Axis::POINT_FIRST(), ModelAPI_AttributeSelection, /** First point */,
76                secondPoint, ConstructionPlugin_Axis::POINT_SECOND(), ModelAPI_AttributeSelection, /** Second point */,
77                cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(), ModelAPI_AttributeSelection, /** Cylindrical face */,
78                xDirection, ConstructionPlugin_Axis::X_DIRECTION(), ModelAPI_AttributeDouble, /** X direction */,
79                yDirection, ConstructionPlugin_Axis::Y_DIRECTION(), ModelAPI_AttributeDouble, /** Y direction */,
80                zDirection, ConstructionPlugin_Axis::Z_DIRECTION(), ModelAPI_AttributeDouble, /** Z direction */,
81                xDimension, ConstructionPlugin_Axis::DX(), ModelAPI_AttributeDouble, /** X dimension */,
82                yDimension, ConstructionPlugin_Axis::DY(), ModelAPI_AttributeDouble, /** Y dimension */,
83                zDimension, ConstructionPlugin_Axis::DZ(), ModelAPI_AttributeDouble, /** Z dimension */,
84                line, ConstructionPlugin_Axis::LINE(), ModelAPI_AttributeSelection, /** Line */,
85                plane, ConstructionPlugin_Axis::PLANE(), ModelAPI_AttributeSelection, /** Plane */,
86                point, ConstructionPlugin_Axis::POINT(), ModelAPI_AttributeSelection, /** Point */,
87                plane1, ConstructionPlugin_Axis::PLANE1(), ModelAPI_AttributeSelection, /** Plane 1 */,
88                useOffset1, ConstructionPlugin_Axis::USE_OFFSET1(), ModelAPI_AttributeString, /** Use offset 1 */,
89                offset1, ConstructionPlugin_Axis::OFFSET1(), ModelAPI_AttributeDouble, /** Offset 1 */,
90                reverseOffset1, ConstructionPlugin_Axis::REVERSE_OFFSET1(), ModelAPI_AttributeBoolean, /** Reverse offset 1 */,
91                plane2, ConstructionPlugin_Axis::PLANE2(), ModelAPI_AttributeSelection, /** Plane 2 */,
92                useOffset2, ConstructionPlugin_Axis::USE_OFFSET2(), ModelAPI_AttributeString, /** Use offset 2 */,
93                offset2, ConstructionPlugin_Axis::OFFSET2(), ModelAPI_AttributeDouble, /** Offset 2 */,
94                reverseOffset2, ConstructionPlugin_Axis::REVERSE_OFFSET2(), ModelAPI_AttributeBoolean, /** Reverse offset 2 */)
95
96   /// Set points
97   CONSTRUCTIONAPI_EXPORT
98   void setByPoints(const ModelHighAPI_Selection& thePoint1,
99                    const ModelHighAPI_Selection& thePoint2);
100
101   /// Set cylindrical face
102   CONSTRUCTIONAPI_EXPORT
103   void setByCylindricalFace(const ModelHighAPI_Selection& theCylindricalFace);
104
105   /// Set direction
106   CONSTRUCTIONAPI_EXPORT
107   void setByPointAndDirection(const ModelHighAPI_Selection& thePoint,
108                               const ModelHighAPI_Double& theX,
109                               const ModelHighAPI_Double& theY,
110                               const ModelHighAPI_Double& theZ);
111
112   /// Set dimensions
113   CONSTRUCTIONAPI_EXPORT
114   void setByDimensions(const ModelHighAPI_Double& theDX,
115                        const ModelHighAPI_Double& theDY,
116                        const ModelHighAPI_Double& theDZ);
117
118   /// Set by line
119   CONSTRUCTIONAPI_EXPORT
120   void setByLine(const ModelHighAPI_Selection& theCylindricalFace);
121
122   /// Set by plane and point
123   CONSTRUCTIONAPI_EXPORT
124   void setByPlaneAndPoint(const ModelHighAPI_Selection& thePlane,
125                           const ModelHighAPI_Selection& thePoint);
126
127   /// Set by two planes
128   CONSTRUCTIONAPI_EXPORT
129   void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
130                       const ModelHighAPI_Selection& thePlane2);
131
132   /// Set by two planes
133   CONSTRUCTIONAPI_EXPORT
134   void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
135                       const ModelHighAPI_Double& theOffset1,
136                       const bool theReverseOffset1,
137                       const ModelHighAPI_Selection& thePlane2,
138                       const ModelHighAPI_Double& theOffset2,
139                       const bool theReverseOffset2);
140 };
141
142 /// Pointer on Axis object
143 typedef std::shared_ptr<ConstructionAPI_Axis> AxisPtr;
144
145 /// \ingroup CPPHighAPI
146 /// \brief Create Axis feature
147 CONSTRUCTIONAPI_EXPORT
148 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
149                 const ModelHighAPI_Selection& theObject1,
150                 const ModelHighAPI_Selection& theObject2);
151
152 /// \ingroup CPPHighAPI
153 /// \brief Create Axis feature
154 CONSTRUCTIONAPI_EXPORT
155 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
156                 const ModelHighAPI_Selection& theObject);
157
158 /// \ingroup CPPHighAPI
159 /// \brief Create Axis feature
160 CONSTRUCTIONAPI_EXPORT
161 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
162                 const ModelHighAPI_Selection& thePoint,
163                 const ModelHighAPI_Double& theX,
164                 const ModelHighAPI_Double& theY,
165                 const ModelHighAPI_Double& theZ);
166
167 /// \ingroup CPPHighAPI
168 /// \brief Create Axis feature
169 CONSTRUCTIONAPI_EXPORT
170 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
171                 const ModelHighAPI_Double& theDX,
172                 const ModelHighAPI_Double& theDY,
173                 const ModelHighAPI_Double& theDZ);
174
175 /// \ingroup CPPHighAPI
176 /// \brief Create Axis feature
177 CONSTRUCTIONAPI_EXPORT
178 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
179                 const ModelHighAPI_Selection& thePlane1,
180                 const ModelHighAPI_Double& theOffset1,
181                 const bool theReverseOffset1,
182                 const ModelHighAPI_Selection& thePlane2,
183                 const ModelHighAPI_Double& theOffset2,
184                 const bool theReverseOffset2);
185
186 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_ */