[vtkusers] 2D contour of x,y, scalar

Jeff Lee jeff at cdnorthamerica.com
Tue Feb 18 13:27:40 EST 2003


you can't really contour points without connectivity.  contouring a cell 
produces a 2d surface, contouring a surface produces a line, contouring 
a line produces a point.
-Jeff

Christopher M. Navarro wrote:

>I have a set of data in the form x, y, scalar that I read in and put the 
>x,y values into vtkPoints and the scalar into a vtkDataArray (the scalars 
>are doubles).  I can't seem to get vtkContourFilter to produce a 2d 
>contour map.  What I do is basically:
>
>vtkPoints mypoints = new vtkPoints();
>/* insert the points */
>vtkDataArray scalars = new vtkDataArray();
>/* insert the scalars */
>vtkPolyData polydata = new vtkPolyData();
>    polydata.SetPoints(mypoints);
>    polydata.GetPointData().SetScalars(scalars);
>vtkContourFilter filter = new vtkContourFilter();
>    filter.SetInput(polydata);
>    filter.GenerateValues(12, range);
>/* create LUT */
>vtkPolyDataMapper mapper = new vtkPolyDataMapper();
>    mapper.SetInput(filter.GetOutput());
>    mapper.SetScalarRange(range);
>    mapper.SetLookupTable(lut);
>vtkActor actor = new vtkActor();
>    actor.SetMapper(mapper);
>
>Is there something obvious I'm missing?
>
>-chris
>
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers
>
>  
>




More information about the vtkusers mailing list