Salome HOME
[PythonAPI] Rename 'modeler' into 'model'
[modules/shaper.git] / src / PythonAPI / model / sketcher / point.py
1 """Sketch point feature interface."""
2
3 from GeomDataAPI import geomDataAPI_Point2D
4
5 class Point():
6     """Interface on point feature for data manipulation."""
7     def __init__(self, point_feature, x, y):
8         self._point_feature = point_feature
9         self._point_data = geomDataAPI_Point2D(
10             self._point_feature.data().attribute("PointCoordinates")
11             )
12         self._point_data.setValue(x, y)
13         self._point_feature.execute()
14
15     def pointData (self):
16         """Return the point data."""
17         return self._point_data
18
19     def result (self):
20         """Return the feature result."""
21         return self._point_feature.firstResult()