[vtkusers] Subset of vtkPoints in vtkUnstructuredGrid

Dirk Fressmann dirk.fressmann at dynamore.de
Mon Nov 3 07:54:11 EST 2008


I am using multiple instances of vtkUnstructuredGrid to setup a finite 
element mesh, consisting of multiple materials, e.g.

grid1 = vtkUnstructuredGrid()
grid1.Allocate(1,1)
grid1.SetPoints(vtkNodes)              <- ?
# defining cell points pts = vtk.vtkIdList() ...
grid1.InsertNextCell(12,pts)
map1 = vtk.vtkDataSetMapper()
map1.SetInput(grid1)
act1 = vtk.vtkActor()
act1.SetMapper(map1)

grid2 = vtkUnstructuredGrid()
grid2.Allocate(1,1)
grid2.SetPoints(vtkNodes)              <- ?
# defining cell points pts = vtk.vtkIdList() ...
grid2.InsertNextCell(12,pts)
map2 = vtk.vtkDataSetMapper()
map2.SetInput(grid2)
act2 = vtk.vtkActor()
act2.SetMapper(map2)

Ideally I only want to deal with one instance of vtkPoints to store all 
nodal points of the mesh.
Is it possible to create a subset of this vtkPoints instance, which is 
set in [vtkUnstructuredGrid].SetPoints(...)?
I could certainly use the whole vtkPoints object (as in the example 
above), but then vtkUnstructuredGrid methods like
GetBounds(), GetCenter(), etc. don't work anymore.

Has anyone an idea?

Regards Dirk



More information about the vtkusers mailing list