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