[vtkusers] from vtkRectilinearGridReader create planes
psdc1978
psdc1978 at gmail.com
Thu Nov 12 11:01:07 EST 2009
Hi,
I've a vtk file of type RECTILINEAR_GRID and I would like to create 3
planes, each for a type of coordinate (xx, yy and zz) but I don't know how
to do it. One plane must be parallel to the XX coordinate at the value 10,
another must be parallel to the YY coordinate at the value 25 and the third
must be in ZZ coordinate at the value 3.
Because the vtk file is a DATASET RECTILINEAR_GRID, I think that the only
way to load this file is using the vtkRectilinearGridReader object. But from
this object I don't know how to create the 3 planes. I really need to set
the origin values from each plane.
How can I do that?
I'm programming in TCL.
Here's the code:
VTK code
[code]
# vtk DataFile Version 1.0
Temperatures at mid-athmosphere
ASCII
DATASET RECTILINEAR_GRID
DIMENSIONS 90 60 5
X_COORDINATES 90 float
-45 -44 -43 -42 -41 -40 -39 -38 -37 -36 -35 -34 -33 -32 -31
-30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16
-15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
Y_COORDINATES 60 float
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
45 46 47 48 49
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
75 76 77 78 79
Z_COORDINATES 5 float
1 21 41 61 81
POINT_DATA 27000
SCALARS Temperature float
LOOKUP_TABLE default
(...)
[/code]
TCL code:
[code]
package require vtk
package require vtkinteraction
# Creation of the window
vtkRenderer ren1
vtkRenderWindow renWin
renWin AddRenderer ren1
vtkRenderWindowInteractor iren
iren SetRenderWindow renWin
vtkRectilinearGridReader reader
reader SetFileName "dados_meteo_T_rg.vtk"
reader Update
vtkRectilinearGridOutlineFilter plane1
plane1 SetInput [reader GetOutput]
vtkPolyDataMapper planeMapper
planeMapper SetInput [plane1 GetOutput]
vtkActor outlineActor
outlineActor SetMapper planeMapper
eval [outlineActor GetProperty] SetColor 0 0 0
ren1 AddActor outlineActor
ren1 SetBackground 1 1 1
iren Initialize
renWin SetSize 500 500
renWin Render
[/code]
Thanks,
--
xeon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091112/612cb0ef/attachment.htm>
More information about the vtkusers
mailing list