1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef SRC_SKETCHAPI_SKETCHAPI_POINT_H_
21 #define SRC_SKETCHAPI_SKETCHAPI_POINT_H_
23 //--------------------------------------------------------------------------------------
24 #include "SketchAPI.h"
26 #include <GeomDataAPI_Point2D.h>
28 #include <SketchPlugin_Point.h>
30 #include "SketchAPI_SketchEntity.h"
31 //--------------------------------------------------------------------------------------
32 class ModelHighAPI_Selection;
33 //--------------------------------------------------------------------------------------
34 /**\class SketchAPI_Point
36 * \brief Interface for Point feature
38 class SketchAPI_Point : public SketchAPI_SketchEntity
41 /// Constructor without values
43 explicit SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature);
44 /// Constructor with values
46 SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
47 double theX, double theY);
48 /// Constructor with values
50 SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
51 const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
52 /// Constructor with values
54 SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
55 const ModelHighAPI_Selection & theExternal);
56 /// Constructor with values
58 SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
59 const std::string & theExternalName);
62 virtual ~SketchAPI_Point();
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 */
71 /// Set by coordinates
73 void setCoordinates(double theX, double theY);
77 void setCoordinates(const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
81 void setByExternal(const ModelHighAPI_Selection & theExternal);
83 /// Set by external name
85 void setByExternalName(const std::string & theExternalName);
87 /// Dump wrapped feature
89 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
92 //! Pointer on Point object
93 typedef std::shared_ptr<SketchAPI_Point> PointPtr;
95 //--------------------------------------------------------------------------------------
96 //--------------------------------------------------------------------------------------
97 #endif /* SRC_SKETCHAPI_SKETCHAPI_POINT_H_ */