| 28 | from vtkmodules.test import Testing |
| 29 | |
| 30 | class vtkCustomObject(vtkObject): |
| 31 | def __init__(self, extra=None): |
| 32 | """Initialize all attributes.""" |
| 33 | if extra is None: |
| 34 | extra = vtkObject() |
| 35 | self._ExtraObject = extra |
| 36 | |
| 37 | def GetClassName(self): |
| 38 | """Get the class name.""" |
| 39 | return self.__class__.__name__ |
| 40 | |
| 41 | def GetExtraObject(self): |
| 42 | """Getter method.""" |
| 43 | return self._ExtraObject |
| 44 | |
| 45 | def SetExtraObject(self, o): |
| 46 | """Setter method.""" |
| 47 | # make sure it is "None" or a vtkobject instance |
| 48 | if o == None or isinstance(o, vtkObjectBase): |
| 49 | self._ExtraObject = o |
| 50 | self.Modified() |
| 51 | else: |
| 52 | raise TypeError("requires None or a vtkobject") |
| 53 | |
| 54 | def GetMTime(self): |
| 55 | """Override a method (only works when called from Python)""" |
| 56 | t = vtkObject.GetMTime(self) |
| 57 | if self._ExtraObject: |
| 58 | t = max(t, self._ExtraObject.GetMTime()) |
| 59 | return t |
| 60 | |
| 61 | class vtkPointsCustom(vtkPoints): |
| 62 | def __init__(self): |
no outgoing calls