Salome HOME
4df2ded9792f8c660e51cf204c5ae3143e196059
[modules/shaper.git] / src / ConstructionAPI / ConstructionAPI_Point.h
1 // Name   : ConstructionAPI_Point.h
2 // Purpose: 
3 //
4 // History:
5 // 29/03/16 - Sergey POKHODENKO - Creation of the file
6
7 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
8 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_
9
10 //--------------------------------------------------------------------------------------
11 #include "ConstructionAPI.h"
12
13 #include <ModelHighAPI_Interface.h>
14 //--------------------------------------------------------------------------------------
15 class ModelAPI_AttributeDouble;
16 class ModelAPI_Document;
17 class ModelHighAPI_Double;
18 //--------------------------------------------------------------------------------------
19 /**\class ConstructionAPI_Point
20  * \ingroup CPPHighAPI
21  * \brief Interface for Point feature
22  */
23 class ConstructionAPI_Point : public ModelHighAPI_Interface
24 {
25 public:
26   /// Constructor without values
27   explicit ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature);
28   /// Constructor with values
29   ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
30                         const ModelHighAPI_Double & theX,
31                         const ModelHighAPI_Double & theY,
32                         const ModelHighAPI_Double & theZ);
33   /// Destructor
34   virtual ~ConstructionAPI_Point();
35
36   /// Set point values
37   void setPoint(const ModelHighAPI_Double & theX,
38                 const ModelHighAPI_Double & theY,
39                 const ModelHighAPI_Double & theZ);
40
41   /// X attribute
42   std::shared_ptr<ModelAPI_AttributeDouble> x() const;
43   /// Y attribute
44   std::shared_ptr<ModelAPI_AttributeDouble> y() const;
45   /// Z attribute
46   std::shared_ptr<ModelAPI_AttributeDouble> z() const;
47
48 protected:
49   std::shared_ptr<ModelAPI_AttributeDouble> myX, myY, myZ;
50
51   bool initialize();
52 };
53
54 //! Pointer on point object
55 typedef std::shared_ptr<ConstructionAPI_Point> PointPtr;
56
57 /**\ingroup CPPHighAPI
58  * \brief Create Point feature
59  */
60 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
61                   const ModelHighAPI_Double & theX,
62                   const ModelHighAPI_Double & theY,
63                   const ModelHighAPI_Double & theZ);
64
65 //--------------------------------------------------------------------------------------
66 //--------------------------------------------------------------------------------------
67 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */