Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PythonAPI / sketcher] end of fix after merge od Dev_1.5.0
[modules/shaper.git]
/
src
/
PythonAPI
/
model
/
sketcher
/
point.py
diff --git
a/src/PythonAPI/model/sketcher/point.py
b/src/PythonAPI/model/sketcher/point.py
index 5ba47e784330a1a633eb84bf647a4ebdf09dcc1c..603a6234adde92835d6f24bd6d5e0a827f3878ef 100644
(file)
--- 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
"""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."""
"""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_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_data.setValue(x, y)
- self._point_feature.execute()
def pointData (self):
"""Return the point data."""
def pointData (self):
"""Return the point data."""