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 .. function:: addPoint(part, x, y, z)
15 part (ModelAPI_Document): part document
16 x (double): X coordinate for the point
17 y (double): Y coordinate for the point
18 z (double): Z coordinate for the point
24 feature = part.addFeature("Point")
25 return Point(feature, *args)
28 class Point(Interface):
29 """Interface class for Point feature.
31 .. function:: Point(feature)
33 Create interface for the feature without initialization.
35 .. function:: Point(feature, x, y, z)
37 Create interface for the feature and initialize the feature with arguments.
40 def __init__(self, feature, *args):
41 """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
42 Interface.__init__(self, feature)
43 assert(self._feature.getKind() == "Point")
45 self._x = self._feature.data().real("x")
46 self._y = self._feature.data().real("y")
47 self._z = self._feature.data().real("z")
56 assert(len(args) == 3)
62 def setPoint(self, x, y, z):
63 """Modify base attribute of the feature.
67 self._fillAttribute(self._x, x)
68 self._fillAttribute(self._y, y)
69 self._fillAttribute(self._z, z)