1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef SRC_SKETCHAPI_SKETCHAPI_POINT_H_
22 #define SRC_SKETCHAPI_SKETCHAPI_POINT_H_
24 //--------------------------------------------------------------------------------------
25 #include "SketchAPI.h"
27 #include <GeomDataAPI_Point2D.h>
29 #include <SketchPlugin_Point.h>
31 #include "SketchAPI_SketchEntity.h"
32 //--------------------------------------------------------------------------------------
33 class ModelHighAPI_Selection;
34 //--------------------------------------------------------------------------------------
35 /**\class SketchAPI_Point
37 * \brief Interface for Point feature
39 class SketchAPI_Point : public SketchAPI_SketchEntity
42 /// Constructor without values
44 explicit SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature);
45 /// Constructor with values
47 SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
48 double theX, double theY);
49 /// Constructor with values
51 SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
52 const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
53 /// Constructor with values
55 SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
56 const ModelHighAPI_Selection & theExternal);
57 /// Constructor with values
59 SketchAPI_Point(const std::shared_ptr<ModelAPI_Feature> & theFeature,
60 const std::string & theExternalName);
63 virtual ~SketchAPI_Point();
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 */
72 /// Set by coordinates
74 void setCoordinates(double theX, double theY);
78 void setCoordinates(const std::shared_ptr<GeomAPI_Pnt2d> & thePoint);
82 void setByExternal(const ModelHighAPI_Selection & theExternal);
84 /// Set by external name
86 void setByExternalName(const std::string & theExternalName);
88 /// Dump wrapped feature
90 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
93 //! Pointer on Point object
94 typedef std::shared_ptr<SketchAPI_Point> PointPtr;
96 //--------------------------------------------------------------------------------------
97 //--------------------------------------------------------------------------------------
98 #endif /* SRC_SKETCHAPI_SKETCHAPI_POINT_H_ */