This is a python friendly wrapper of a vtkPointSet that defines a few useful properties.
| 1369 | CellData = property(GetCellData, None, None, "This property returns the cell data of a dataset.") |
| 1370 | |
| 1371 | class PointSet(DataSet): |
| 1372 | """This is a python friendly wrapper of a vtkPointSet that defines |
| 1373 | a few useful properties.""" |
| 1374 | def GetPoints(self): |
| 1375 | """Returns the points as a VTKArray instance. Returns None if the |
| 1376 | dataset has implicit points.""" |
| 1377 | if not self.VTKObject.GetPoints(): |
| 1378 | return None |
| 1379 | array = vtkDataArrayToVTKArray( |
| 1380 | self.VTKObject.GetPoints().GetData(), self) |
| 1381 | array.Association = ArrayAssociation.POINT |
| 1382 | return array |
| 1383 | |
| 1384 | def SetPoints(self, pts): |
| 1385 | """Given a VTKArray instance, sets the points of the dataset.""" |
| 1386 | from ..vtkCommonCore import vtkPoints |
| 1387 | if isinstance(pts, vtkPoints): |
| 1388 | p = pts |
| 1389 | else: |
| 1390 | pts = numpyTovtkDataArray(pts) |
| 1391 | p = vtkPoints() |
| 1392 | p.SetData(pts) |
| 1393 | self.VTKObject.SetPoints(p) |
| 1394 | |
| 1395 | Points = property(GetPoints, SetPoints, None, "This property returns the point coordinates of dataset.") |
| 1396 | |
| 1397 | class PolyData(PointSet): |
| 1398 | """This is a python friendly wrapper of a vtkPolyData that defines |