Salome HOME
Merge branch 'CPPHighAPI'
[modules/shaper.git] / src / ConstructionAPI / ConstructionAPI_Axis.h
1 // Name   : ConstructionAPI_Axis.h
2 // Purpose: 
3 //
4 // History:
5 // 15/06/16 - Sergey POKHODENKO - Creation of the file
6
7 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
8 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
9
10 //--------------------------------------------------------------------------------------
11 #include "ConstructionAPI.h"
12
13 #include <ConstructionPlugin_Axis.h>
14
15 #include <ModelHighAPI_Interface.h>
16 #include <ModelHighAPI_Macro.h>
17 //--------------------------------------------------------------------------------------
18 class ModelHighAPI_Double;
19 class ModelHighAPI_Selection;
20 //--------------------------------------------------------------------------------------
21 /**\class ConstructionAPI_Axis
22  * \ingroup CPPHighAPI
23  * \brief Interface for Axis feature
24  */
25 class ConstructionAPI_Axis : public ModelHighAPI_Interface
26 {
27 public:
28   /// Constructor without values
29   CONSTRUCTIONAPI_EXPORT
30   explicit ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature> & theFeature);
31   /// Constructor with values
32   CONSTRUCTIONAPI_EXPORT
33   ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature> & theFeature,
34                        const ModelHighAPI_Selection & thePoint1,
35                        const ModelHighAPI_Selection & thePoint2);
36   /// Constructor with values
37   CONSTRUCTIONAPI_EXPORT
38   ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature> & theFeature,
39                        const ModelHighAPI_Selection & theCylindricalFace);
40   /// Constructor with values
41   CONSTRUCTIONAPI_EXPORT
42   ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature> & theFeature,
43                        const ModelHighAPI_Selection & thePoint,
44                        const ModelHighAPI_Double & theX,
45                        const ModelHighAPI_Double & theY,
46                        const ModelHighAPI_Double & theZ);
47   /// Destructor
48   CONSTRUCTIONAPI_EXPORT
49   virtual ~ConstructionAPI_Axis();
50
51   INTERFACE_7(ConstructionPlugin_Axis::ID(),
52               creationMethod, ConstructionPlugin_Axis::METHOD(), ModelAPI_AttributeString, /** Creation method */,
53               firstPoint, ConstructionPlugin_Axis::POINT_FIRST(), ModelAPI_AttributeSelection, /** First point */,
54               secondPoint, ConstructionPlugin_Axis::POINT_SECOND(), ModelAPI_AttributeSelection, /** Second point */,
55               cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(), ModelAPI_AttributeSelection, /** Cylindrical face */,
56               xDirection, ConstructionPlugin_Axis::X_DIRECTION(), ModelAPI_AttributeDouble, /** X direction */,
57               yDirection, ConstructionPlugin_Axis::Y_DIRECTION(), ModelAPI_AttributeDouble, /** Y direction */,
58               zDirection, ConstructionPlugin_Axis::Z_DIRECTION(), ModelAPI_AttributeDouble, /** Z direction */
59   )
60
61   /// Set points
62   CONSTRUCTIONAPI_EXPORT
63   void setPoints(const ModelHighAPI_Selection & thePoint1,
64                  const ModelHighAPI_Selection & thePoint2);
65
66   /// Set cylindrical face
67   CONSTRUCTIONAPI_EXPORT
68   void setCylindricalFace(const ModelHighAPI_Selection & theCylindricalFace);
69
70   /// Set direction
71   CONSTRUCTIONAPI_EXPORT
72   void setPointAndDirection(const ModelHighAPI_Selection & thePoint,
73                             const ModelHighAPI_Double & theX,
74                             const ModelHighAPI_Double & theY,
75                             const ModelHighAPI_Double & theZ);
76 };
77
78 //! Pointer on Axis object
79 typedef std::shared_ptr<ConstructionAPI_Axis> AxisPtr;
80
81 /**\ingroup CPPHighAPI
82  * \brief Create Axis feature
83  */
84 CONSTRUCTIONAPI_EXPORT
85 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document> & thePart,
86                 const ModelHighAPI_Selection & thePoint1,
87                 const ModelHighAPI_Selection & thePoint2);
88
89 /**\ingroup CPPHighAPI
90  * \brief Create Axis feature
91  */
92 CONSTRUCTIONAPI_EXPORT
93 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document> & thePart,
94                 const ModelHighAPI_Selection & theCylindricalFace);
95
96 /**\ingroup CPPHighAPI
97  * \brief Create Axis feature
98  */
99 CONSTRUCTIONAPI_EXPORT
100 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document> & thePart,
101                 const ModelHighAPI_Selection & thePoint,
102                 const ModelHighAPI_Double & theX,
103                 const ModelHighAPI_Double & theY,
104                 const ModelHighAPI_Double & theZ);
105
106 //--------------------------------------------------------------------------------------
107 //--------------------------------------------------------------------------------------
108 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_ */