[vtkusers] Contours from vtkUnstructuredGrid

Bert Maleszka bert.maleszka at chello.be
Thu Sep 23 14:16:39 EDT 2004


Hi,

I want to create contours (vtkContourFilter) from an unstructured grid. This 
grid only contains point info though. No cell information at all.
I tried it as follows:

      m_vtkContour->SetInput(data);
      m_vtkContour->GenerateValues(2, -1.0, 1.0);
      m_vtkContour->Update();
      m_vtkMapper->SetInput(m_vtkContour->GetOutput());
      m_vtkRenderWindow->Render();

Where m_vtkContour is a vtkContourFilter, m_vtkMapper is a vtkPolyDataMapper, 
m_vtkRenderWindow is a vtkRenderWindow and data is the vtkUnstructuredGrid. 
In the redering phase I get some debug info (no data to contour).

A dump of the data looks as follows:

ASCII
DATASET UNSTRUCTURED_GRID
POINTS 3610 float
0 0 0 0 0 0.111111 0 0 0.222222 
....
CELL_TYPES 0

POINT_DATA 3610
SCALARS scalars double
LOOKUP_TABLE default
0 0 0 0 0 0 0 0 0 
0 1 1 1 0 0 0 0 0
....

The dump of the vtkContourFilter look as follows:

# vtk DataFile Version 3.0
vtk output
ASCII
DATASET POLYDATA
POINTS 0 float

Any suggestions?
Thanks,

Bert Maleszka



More information about the vtkusers mailing list