[vtkusers] Problem getting correct results with vtkProjectedTerrainPath
elvis.dowson at mac.com
Mon Nov 10 13:21:57 EST 2008
Could you please help me out by giving me a code
fragment on how to achieve this? I have created an outline below.
I've created a vtkImageData and set it's dimensions by reading the max
extent of the original DEM file. I hope that is correct. Now
vtkProjectedPath::SetSource(vtkImageData* ) expects a vtkImageData*,
and I don't know how to pass the vtkImageData object called
elevationData to this method. I have highlighted it in red below.
I have put the wrap scalar code fragment below. Could you please help
me with a code fragment to extract the vtkImageData from the wrap
# Create a reader to read the unstructured grid data.
reader SetFileName "SampleDEM.vtk"
# Get the physical xy extent of dataset
scan [[reader GetOutput] GetWholeExtent] "%d %d %d %d %d %d" XminR
XmaxR YminR YmaxR ZminR ZmaxR
# Now warp the surface based on the scalar elevation values
# This creates the 3D mesh model of the terrain.
surface SetInput [geom GetOutput]
surface SetScaleFactor 0.1; # $scale variable controls vertical
# Use a probe filter to obtain elevation data from the reconstructed
elevationData SetDimensions $XmaxR $YmaxR $ZmaxR
projectedPaths SetInput terrainPaths
projectedPaths SetSource [elevationData]
projectedPaths SetHeightOffset 25
projectedPaths SetHeightTolerance 5
On Nov 10, 2008, at 6:31 PM, Amy Squillacote wrote:
> Hi Elvis,
> You could try using a vtkProbeFilter: http://www.vtk.org/doc/nightly/html/classvtkProbeFilter.html
> . Create an empty vtkImageData (sized and positioned to encompass
> the output of your vtkWarpScalar filter), and pass it as the
> "source" (2nd input) to vtkProbeFilter.
> - Amy
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers