1 """Sketch point feature interface."""
3 from GeomDataAPI import geomDataAPI_Point2D
4 from model.roots import Interface
5 from model.errors import FeatureInputInvalid
7 class Point(Interface):
8 """Interface on point feature for data manipulation."""
9 def __init__(self, feature, x, y):
10 Interface.__init__(self, feature)
11 assert(self._feature.getKind() == "SketchPoint")
13 # Initialize attributes of the feature
14 self._point_data = geomDataAPI_Point2D(
15 self._feature.data().attribute("PointCoordinates")
20 def setValue(self, x, y):
21 """Set point coordinates."""
22 self._point_data.setValue(x, y)
25 """Return the point data."""
26 return self._point_data
29 """Return the feature result."""
30 return self._point_feature.firstResult()