SHAPER  9.12.0
SketchAPI_Point.h
1 // Copyright (C) 2014-2023 CEA, EDF
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 //--------------------------------------------------------------------------------------
33 //--------------------------------------------------------------------------------------
39 {
40 public:
42  SKETCHAPI_EXPORT
43  explicit SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature);
45  SKETCHAPI_EXPORT
46  SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
47  double theX, double theY);
49  SKETCHAPI_EXPORT
50  SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
51  const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
53  SKETCHAPI_EXPORT
54  SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
55  const ModelHighAPI_Selection & theExternal);
57  SKETCHAPI_EXPORT
58  SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
59  const std::wstring & theExternalName);
61  SKETCHAPI_EXPORT
62  virtual ~SketchAPI_Point();
63 
64  INTERFACE_2(SketchPlugin_Point::ID(),
69  )
70 
71 
72  SKETCHAPI_EXPORT
73  void setCoordinates(double theX, double theY);
74 
76  SKETCHAPI_EXPORT
77  void setCoordinates(const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
78 
80  SKETCHAPI_EXPORT
81  void setByExternal(const ModelHighAPI_Selection & theExternal);
82 
84  SKETCHAPI_EXPORT
85  void setByExternalName(const std::wstring & theExternalName);
86 
88  SKETCHAPI_EXPORT
89  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
90 };
91 
93 typedef std::shared_ptr<SketchAPI_Point> PointPtr;
94 
95 //--------------------------------------------------------------------------------------
96 //--------------------------------------------------------------------------------------
97 #endif /* SRC_SKETCHAPI_SKETCHAPI_POINT_H_ */
2D point defined by two coordinates
Definition: GeomAPI_Pnt2d.h:36
Attribute that contains 2D point coordinates.
Definition: GeomDataAPI_Point2D.h:37
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
Interface for Point feature.
Definition: SketchAPI_Point.h:39
virtual ~SketchAPI_Point()
Destructor.
Definition: SketchAPI_Point.cpp:75
SketchAPI_Point(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: SketchAPI_Point.cpp:28
virtual std::shared_ptr< ModelAPI_AttributeSelection > external() const
External.
Definition: SketchAPI_Point.h:69
void setByExternal(const ModelHighAPI_Selection &theExternal)
Set by external.
Definition: SketchAPI_Point.cpp:97
virtual std::shared_ptr< GeomDataAPI_Point2D > coordinates() const
Point coordinates.
Definition: SketchAPI_Point.h:69
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: SketchAPI_Point.cpp:113
void setByExternalName(const std::wstring &theExternalName)
Set by external name.
Definition: SketchAPI_Point.cpp:104
void setCoordinates(double theX, double theY)
Set by coordinates.
Definition: SketchAPI_Point.cpp:81
Base class for Sketch feature interfaces.
Definition: SketchAPI_SketchEntity.h:38
static const std::string & ID()
Point feature kind.
Definition: SketchPlugin_Point.h:36
static const std::string & COORD_ID()
Coordinates of the point.
Definition: SketchPlugin_Point.h:42
static const std::string & EXTERNAL_ID()
Reference to the external edge or vertex as a AttributeSelection.
Definition: SketchPlugin_SketchEntity.h:55