Salome HOME
Add SketchAPI_Point
[modules/shaper.git] / src / SketchAPI / SketchAPI_Point.h
1 // Name   : SketchAPI_Point.h
2 // Purpose: 
3 //
4 // History:
5 // 15/06/16 - Sergey POKHODENKO - Creation of the file
6
7 #ifndef SRC_SKETCHAPI_SKETCHAPI_POINT_H_
8 #define SRC_SKETCHAPI_SKETCHAPI_POINT_H_
9
10 //--------------------------------------------------------------------------------------
11 #include "SketchAPI.h"
12
13 #include <GeomDataAPI_Point2D.h>
14
15 #include <SketchPlugin_Point.h>
16
17 #include "SketchAPI_SketchEntity.h"
18 //--------------------------------------------------------------------------------------
19 class ModelHighAPI_Selection;
20 //--------------------------------------------------------------------------------------
21 /**\class SketchAPI_Point
22  * \ingroup CPPHighAPI
23  * \brief Interface for Point feature
24  */
25 class SketchAPI_Point : public SketchAPI_SketchEntity
26 {
27 public:
28   /// Constructor without values
29   SKETCHAPI_EXPORT
30   explicit SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature);
31   /// Constructor with values
32   SKETCHAPI_EXPORT
33   SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
34                  double theX, double theY);
35   /// Constructor with values
36   SKETCHAPI_EXPORT
37   SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
38                  const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
39   /// Constructor with values
40   SKETCHAPI_EXPORT
41   SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
42                  const ModelHighAPI_Selection & theExternal);
43   /// Constructor with values
44   SKETCHAPI_EXPORT
45   SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
46                  const std::string & theExternalName);
47   /// Destructor
48   SKETCHAPI_EXPORT
49   virtual ~SketchAPI_Point();
50
51   INTERFACE_2(SketchPlugin_Point::ID(),
52               coordinates, SketchPlugin_Point::COORD_ID(), GeomDataAPI_Point2D, /** Point coordinates */,
53               external, SketchPlugin_Point::EXTERNAL_ID(), ModelAPI_AttributeSelection, /** External */
54   )
55
56   /// Set by coordinates
57   SKETCHAPI_EXPORT
58   void setCoordinates(double theX, double theY);
59
60   /// Set by points
61   SKETCHAPI_EXPORT
62   void setCoordinates(const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
63
64   /// Set by external
65   SKETCHAPI_EXPORT
66   void setByExternal(const ModelHighAPI_Selection & theExternal);
67
68   /// Set by external name
69   SKETCHAPI_EXPORT
70   void setByExternalName(const std::string & theExternalName);
71 };
72
73 //! Pointer on Point object
74 typedef std::shared_ptr<SketchAPI_Point> PointPtr;
75
76 //--------------------------------------------------------------------------------------
77 //--------------------------------------------------------------------------------------
78 #endif /* SRC_SKETCHAPI_SKETCHAPI_POINT_H_ */