Do we even need the filter if you want to display all of the grid?  DataSetMapper should
convert the entire grid into the needed geometry and the interactor can be used to switch between
wireframe and surface. I am already doing that with StructuredPoints and should be no different
with StructuredGrid (in fact, I have done it with StructuredGrid).

    -- krs
 

Jim Moore wrote:

 I think that wholeFilter  needs the following:

wholeFilter SetExtent 0 [expr $n0-1] 0 [expr $n0-1] 0 [expr$n0-1]

This will force it to create the planes of the geometry for the mapper (as I understand it).

Good luck,
Jim
 

drew@pixar.com wrote:

I've been trying to do something simple but don't seem to be
having much luck. I want to display the surface of a StructuredGrid
as a solid (or even a wireframe). When I execute the code below
all I get is a 5x5x5 grid of points. Anyone have any idea what
I'm doing wrong?

Drew
drew@pixar.com

#!/usr/local/bin/vtk

catch {load vtktcl}

# create a window to render into
vtkRenderWindow renWin
vtkRenderer ren1
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin

set n0 5
set n0m1 [expr $n0 - 1]
vtkFloatPoints points
for {set x 0} {$x < $n0} {incr x} {
    for {set y 0} {$y < $n0} {incr y} {
        for {set z 0} {$z < $n0} {incr z} {
            points InsertNextPoint [expr (1.0/$n0m1) * $x] \
                                   [expr (1.0/$n0m1) * $y] \
                                   [expr (1.0/$n0m1) * $z]
        }
    }
}

#
# The whole enchilada
vtkStructuredGrid grid
    grid SetDimensions $n0 $n0 $n0
    grid SetPoints points

vtkStructuredGridGeometryFilter wholeFilter
    wholeFilter SetInput grid

vtkDataSetMapper wholeMapper
    wholeMapper SetInput [wholeFilter GetOutput]

vtkActor theWhole
    theWhole SetMapper wholeMapper
    [theWhole GetProperty] SetRepresentationToSurface

ren1 AddActor theWhole

# Render an image; since no lights/cameras specified, created automatically
renWin Render;

# Begin mouse interaction
iren Start;

-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo@gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------

-- 
James C Moore, Vice President
URS Technologies, LLC
ph: 614-540-8041, jmoore@qn.net
 
 
-- 
K.R.Subramanian                           Phone: (704) 547-4872
Department of Computer Science            FAX:   (704) 547-3516
UNC Charlotte                             Email: krs@cs.uncc.edu
9201 Univ. City Blvd.                     WWW: http://www.cs.uncc.edu/~krs
Charlotte, NC 28223-0001