X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPythonAPI%2Fmodel%2Fsketcher%2Fpoint.py;h=603a6234adde92835d6f24bd6d5e0a827f3878ef;hb=7e91e3e7e8e5f38b04b958c228c42726f7438108;hp=5ba47e784330a1a633eb84bf647a4ebdf09dcc1c;hpb=659f615574a9d3e4bf72ccc053e1a1d45d88e116;p=modules%2Fshaper.git diff --git a/src/PythonAPI/model/sketcher/point.py b/src/PythonAPI/model/sketcher/point.py index 5ba47e784..603a6234a 100644 --- a/src/PythonAPI/model/sketcher/point.py +++ b/src/PythonAPI/model/sketcher/point.py @@ -1,16 +1,25 @@ """Sketch point feature interface.""" from GeomDataAPI import geomDataAPI_Point2D +from model.roots import Interface +from model.errors import FeatureInputInvalid -class Point(): +class Point(Interface): """Interface on point feature for data manipulation.""" - def __init__(self, point_feature, x, y): - self._point_feature = point_feature + def __init__(self, feature, x, y): + Interface.__init__(self, feature) + assert(self._feature.getKind() == "SketchPoint") + + # Initialize attributes of the feature self._point_data = geomDataAPI_Point2D( - self._point_feature.data().attribute("PointCoordinates") + self._feature.data().attribute("PointCoordinates") ) + self.setValue(x, y) + self.execute() + + def setValue(self, x, y): + """Set point coordinates.""" self._point_data.setValue(x, y) - self._point_feature.execute() def pointData (self): """Return the point data."""