[vtkusers] Contours at boundary of a rectilinear grid

Steve Joyce Steve.Joyce at sercoassurance.com
Tue Oct 28 04:23:55 EST 2003


Hi,

I am using vtkContourFilter to plot isosurfaces on a
vtkRectilinearGrid.
My scalar data is cell based, so I am converting it to point data
first.
The contours appear OK, except where they are exactly on the boundary
of the grid, where they are not visible. Is there any way to make
contours on the boundary visible?

Thanks,
Steve

I am using VTK 4.2.3 with Java 1.4.2_01 on Windows XP.
The relevant section of code is:

            
            // Convert cell scalar values to point values
            vtkCellDataToPointData pointFilter = new
vtkCellDataToPointData();
            pointFilter.SetInput(grid);
            pointFilter.PassCellDataOn();
            
            // Create contours for isosurfaces
            vtkContourFilter contours = new vtkContourFilter();
            contours.SetInput(pointFilter.GetOutput());
            for (int i = 0; i < values.length; ++i) {
                contours.SetValue(i, values[i]);
            }
            
            // Create a mapper for the isosurfaces
            vtkPolyDataMapper mapper = new vtkPolyDataMapper();
            mapper.SetInput(contours.GetOutput());
            mapper.ScalarVisibilityOn();
            
            // Create an actor for the isosurfaces
            vtkLODActor actor = new vtkLODActor();
            actor.GetProperty().SetRepresentationToSurface();
            actor.SetMapper(mapper);
            
            // Add the actor
            renderer.AddProp(actor);





****Disclaimer***********
This e-mail and any attachments may contain confidential and/or privileged material; it  is for the intended addressee(s) only.  If you are not a named addressee, you must not use, retain or disclose such information.
 
Serco cannot guarantee that the e-mail or any attachments are free from viruses.
 
The views expressed in this e-mail are those of the originator and do not necessarily represent the views of Serco.
 
Nothing in this e-mail shall bind Serco in any contract or obligation.
 
Serco Group plc.  Registered in England and Wales.  No: 2048608
Registered Office:  Serco House, 16 Bartley Wood Business Park, Bartley Way, Hook, Hampshire, RG27 9UY, United Kingdom.
****End Disclaimer*******
<<<<GWIASIG 0.07>>>>



More information about the vtkusers mailing list