[vtkusers] Simple vtkStructured grid file wt. scalars.

Fletcher, Bob (GEAE) bob.fletcher at ae.ge.com
Thu Oct 12 11:43:01 EDT 2000

I have to be doing something stupid.  I'm trying to write  a simple vtk
structured grid data file.

Here is a vtk data file, extracted from office.vtk   Does anyone else's set of
eyes see the problem?
# vtk DataFile Version 1.0
Test File


POINTS 4 float
  0.0099999988 0.0099999988 0.0099999988
  0.050000001 0.0099999988 0.0099999988
  0.0099999988 0.40000001 0.0099999988
  0.050000001 0.40000001 0.0099999988

SCALARS p1 float

When I try to read it  on a recent nightly build on HPUX 10.20 I get the error
The script below shows the geometry, but I'm not getting the scalars.

c0529$ vtk short.tcl
ERROR: In vtkStructuredGridReader.cxx, line 390
vtkStructuredGridReader (0x403209b8): Unrecognized keyword: scalars

Here is a script to read it.  The same script will read and display kitchen.vtk
without errors, but I can't see any difference between the Office.vtk file, and
my short file.....


if { [catch {set VTK_TCL $env(VTK_TCL)}] != 0} { set VTK_TCL "../../examplesTcl"
if { [catch {set VTK_DATA $env(VTK_DATA)}] != 0} { set VTK_DATA
"../../../vtkdata" }

# get the interactor ui
source $VTK_TCL/vtkInt.tcl
source $VTK_TCL/colors.tcl
source $VTK_TCL/vtkInclude.tcl

vtkRenderer ren1
vtkRenderWindow renWin
    renWin AddRenderer ren1
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin

# read data
vtkStructuredGridReader reader
    reader SetFileName "short.vtk"
    reader Update;#force a read to occur

vtkGeometryFilter dstopy
dstopy SetInput [reader GetOutput]

vtkPolyDataMapper mapset
mapset  SetInput [dstopy GetOutput]

vtkActor gridactor
    gridactor SetMapper mapset

ren1 AddActor gridactor
ren1 SetBackground 1 1 1
renWin SetSize 500 500
ren1 SetBackground 0.1 0.2 0.4

#vtkCamera aCamera

#ren1 SetActiveCamera aCamera

iren SetUserMethod {wm deiconify .vtkInteract}
iren Initialize

# interact with data
wm withdraw .

More information about the vtkusers mailing list