Salome HOME
Merge branch 'Pre_2.8.0_development'
[modules/shaper.git] / src / SketchAPI / SketchAPI_Point.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 SRC_SKETCHAPI_SKETCHAPI_POINT_H_
22 #define SRC_SKETCHAPI_SKETCHAPI_POINT_H_
23
24 //--------------------------------------------------------------------------------------
25 #include "SketchAPI.h"
26
27 #include <GeomDataAPI_Point2D.h>
28
29 #include <SketchPlugin_Point.h>
30
31 #include "SketchAPI_SketchEntity.h"
32 //--------------------------------------------------------------------------------------
33 class ModelHighAPI_Selection;
34 //--------------------------------------------------------------------------------------
35 /**\class SketchAPI_Point
36  * \ingroup CPPHighAPI
37  * \brief Interface for Point feature
38  */
39 class SketchAPI_Point : public SketchAPI_SketchEntity
40 {
41 public:
42   /// Constructor without values
43   SKETCHAPI_EXPORT
44   explicit SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature);
45   /// Constructor with values
46   SKETCHAPI_EXPORT
47   SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
48                  double theX, double theY);
49   /// Constructor with values
50   SKETCHAPI_EXPORT
51   SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
52                  const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
53   /// Constructor with values
54   SKETCHAPI_EXPORT
55   SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
56                  const ModelHighAPI_Selection & theExternal);
57   /// Constructor with values
58   SKETCHAPI_EXPORT
59   SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
60                  const std::string & theExternalName);
61   /// Destructor
62   SKETCHAPI_EXPORT
63   virtual ~SketchAPI_Point();
64
65   INTERFACE_2(SketchPlugin_Point::ID(),
66               coordinates, SketchPlugin_Point::COORD_ID(),
67               GeomDataAPI_Point2D, /** Point coordinates */,
68               external, SketchPlugin_Point::EXTERNAL_ID(),
69               ModelAPI_AttributeSelection, /** External */
70   )
71
72   /// Set by coordinates
73   SKETCHAPI_EXPORT
74   void setCoordinates(double theX, double theY);
75
76   /// Set by points
77   SKETCHAPI_EXPORT
78   void setCoordinates(const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
79
80   /// Set by external
81   SKETCHAPI_EXPORT
82   void setByExternal(const ModelHighAPI_Selection & theExternal);
83
84   /// Set by external name
85   SKETCHAPI_EXPORT
86   void setByExternalName(const std::string & theExternalName);
87
88   /// Dump wrapped feature
89   SKETCHAPI_EXPORT
90   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
91 };
92
93 //! Pointer on Point object
94 typedef std::shared_ptr<SketchAPI_Point> PointPtr;
95
96 //--------------------------------------------------------------------------------------
97 //--------------------------------------------------------------------------------------
98 #endif /* SRC_SKETCHAPI_SKETCHAPI_POINT_H_ */