[vtkusers] Problem getting correct results with vtkProjectedTerrainPath

Elvis Dowson elvis.dowson at mac.com
Mon Nov 10 14:12:42 EST 2008


Hi Amy,
                 Is this the correct way to do it? I'm getting an  
interpreter error for vtkProjectTerrainPath::SetSource(vtkImageData* )

vtkPolyData terrainPaths
   terrainPaths SetPoints pts
   terrainPaths SetLines lines

# Use a probe filter to obtain elevation data from the reconstructed  
surface
vtkImageData elevationData
   elevationData SetDimensions $XmaxR $YmaxR $ZmaxR

vtkProbeFilter probe
   probe SetInput  [surface GetOutput]
   probe SetSource elevationData

vtkProjectedTerrainPath projectedPaths
   projectedPaths SetInput terrainPaths
   projectedPaths SetSource [probe GetOutput]

Best regards,

Elvis Dowson


On Nov 10, 2008, at 10:21 PM, Elvis Dowson wrote:

> Hi Amy,
>                  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 scalar output?
>
> # Create a reader to read the unstructured grid data.
> vtkDataSetReader reader
>     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.
> vtkWarpScalar surface
>   surface SetInput [geom GetOutput]
>   surface SetScaleFactor 0.1; # $scale variable controls vertical  
> exaggeration
>
> ....
>
> # Use a probe filter to obtain elevation data from the reconstructed  
> surface
> vtkImageData elevationData
>   elevationData SetDimensions $XmaxR $YmaxR $ZmaxR
>
> #vtkProbeFilter
>
> vtkProjectedTerrainPath projectedPaths
>   projectedPaths SetInput terrainPaths
>   projectedPaths SetSource [elevationData]
>   projectedPaths SetHeightOffset 25
>   projectedPaths SetHeightTolerance 5
>   projectedPaths SetProjectionModeToNonOccluded
>   projectedPaths SetProjectionModeToHug
>
> Best regards,
>
> Elvis Dowson
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081110/5ec9f05b/attachment.htm>


More information about the vtkusers mailing list