[vtkusers] Pb with vtkMarchingSquare

Thomas Deschamps tdeschamps at lbl.gov
Thu Jul 18 16:11:31 EDT 2002


Hi Vtk-users,

I have a little problem using vtkMarchingSquare
I have a vtkStructuredPoints with values between 0. and 1.
I can display it using a carpet plot (vtkWarpScalar, etc...).
I want to extract several isolines of it.
Here is the code:

----------------------------------------------------------------------------------

package require vtk
package require vtkinteraction

vtkStructuredPointsReader reader
 reader SetFileName "/home/deschamp/Projects/toto.vtk"

vtkMarchingSquares msquare
 msquare SetInput [reader GetOutput]
 msquare GenerateValues 10 0.0 1.0
 msquare CreateDefaultLocator

vtkPolyDataMapper msquareMapper
 msquareMapper SetInput [msquare GetOutput]

vtkActor contourActor
 contourActor SetMapper msquareMapper
 eval [contourActor GetProperty] SetColor 1. 0. 0.

vtkRenderer render
vtkRenderWindow renWin
 renWin AddRenderer render
vtkRenderWindowInteractor iren
 iren SetRenderWindow renWin
 render AddActor contourActor

# render the image
iren Initialize
iren AddObserver UserEvent {wm deiconify .vtkInteract}

wm withdraw .
--------------------------------------------------------------------------------

I obtain a blank image.
Do you know what I forgot?

Many thanks for your help.

Thomas




More information about the vtkusers mailing list