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.
15 feature = part.addFeature("Point")
16 return Point(feature, *args)
19 class Point(Interface):
20 """Interface class for Point feature.
22 Point(feature) -> feature interface without initialization
23 Point(feature, x, y, z) ->
24 feature interface initialized from arguments:
25 - x, y, z -- coordinates for the point
28 def __init__(self, feature, *args):
29 """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
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")
44 assert(len(args) == 3)
50 def setPoint(self, x, y, z):
51 """Modify base attribute of the feature.
55 self._fillAttribute(self._x, x)
56 self._fillAttribute(self._y, y)
57 self._fillAttribute(self._z, z)