[vtkusers] Simple vtkStructured grid file wt. scalars.

Amy Henderson amy.henderson at kitware.com
Thu Oct 12 13:22:10 EDT 2000


Add the line "POINT_DATA 4" before the line "SCALARS p1 float".  There's a 
similar line in office.vtk, but then there's a list of vectors between that 
line and the list of scalars.

Amy

At 11:43 AM 10/12/2000 -0400, Fletcher, Bob (GEAE) wrote:

>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
>
>ASCII
>
>DATASET STRUCTURED_GRID
>DIMENSIONS 1 2 2
>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
>LOOKUP_TABLE default
>   -3.8648391
>   -3.8647611
>   -3.8647821
>   -3.864938
>
>-------------------------------------------------------------------------
>When I try to read it  on a recent nightly build on HPUX 10.20 I get the error
>below.
>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.....
>
>short.tcl
>--------------------------------------------------------------------------------
>----------------------------------------------------------
>
>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 .
>
>
>
>
>
>
>
>
>_______________________________________________
>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