A wrapper for vtkDataObject that makes it easier to access FielData arrays as VTKArrays
| 1190 | return self.__next__() |
| 1191 | |
| 1192 | class DataObject(VTKObjectWrapper): |
| 1193 | """A wrapper for vtkDataObject that makes it easier to access FielData |
| 1194 | arrays as VTKArrays |
| 1195 | """ |
| 1196 | |
| 1197 | def GetAttributes(self, type): |
| 1198 | """Returns the attributes specified by the type as a DataSetAttributes |
| 1199 | instance.""" |
| 1200 | if type == ArrayAssociation.FIELD: |
| 1201 | return self.GetFieldData() |
| 1202 | return DataSetAttributes(self.VTKObject.GetAttributesAsFieldData(type), self, type) |
| 1203 | |
| 1204 | def HasAttributes(self, type): |
| 1205 | "Returns if current object support this attributes type" |
| 1206 | return type == ArrayAssociation.FIELD |
| 1207 | |
| 1208 | def GetFieldData(self): |
| 1209 | "Returns the field data as a DataSetAttributes instance." |
| 1210 | return DataSetAttributes(self.VTKObject.GetFieldData(), self, ArrayAssociation.FIELD) |
| 1211 | |
| 1212 | FieldData = property(GetFieldData, None, None, "This property returns the field data of a data object.") |
| 1213 | |
| 1214 | class Table(DataObject): |
| 1215 | """A wrapper for vtkTable that makes it easier to access RowData array as |