2 Author: Sergey Pokhodenko
3 Copyright (C) 2014-20xx CEA/DEN, EDF R&D
6 from model.roots import Interface
9 def addPoint(part, *args):
10 """Add an Point feature to the Part and return Point.
12 Pass all args to Point __init__ function.
14 feature = part.addFeature("Point")
15 return Point(feature, *args)
18 class Point(Interface):
19 """Interface on an Point feature."""
21 def __init__(self, feature, *args):
22 """Initialize an Point feature with given parameters.
24 Expected arguments for all modes:
25 feature -- a Point feature
27 Expected arguments for initializing the feature:
28 x, y, z -- x, y, z coordinates for the point.
30 Interface.__init__(self, feature)
31 assert(self._feature.getKind() == "Point")
33 self._x = self._feature.data().real("x")
34 self._y = self._feature.data().real("y")
35 self._z = self._feature.data().real("z")
47 def setPoint(self, x, y, z):
48 """Modify base attribute of the feature.
52 self._fill_attribute(self._x, x)
53 self._fill_attribute(self._y, y)
54 self._fill_attribute(self._z, z)