[vtkusers] vtkGreedyTerrainDecimation problem

Manoj Mohadikar manoj_mohadikar at persistent.co.in
Mon Apr 3 08:49:40 EDT 2006


 

Hi,

I am new to vtk. I have vtkPolyData as input. I need to use
vtkGreedyTerrainDecimation algorithm for the decimation.

For vtkGreedyTerrainDecimation, input is expected as vtkImageData, so I used
vtkProbeFilter toconvert the vtkPolyData to vtkImageData  as follows:

 

                                                vtkGreedyTerrainDecimation*
decimate  = vtkGreedyTerrainDecimation::New();

                                                vtkImageData* imageData  =
vtkImageData::New(); 

                                                vtkProbeFilter* probeFilter
= vtkProbeFilter::New();

 

 
probeFilter->SetInput(imageData); 

 
probeFilter->SetSource(polyData);  // polyData is a member of my class

 
probeFilter->SetInputConnection(polyData->GetProducerPort()); 

 and passed this vtkImageData to  vtkGreedyTerrainDecimation as follows:

 

 
decimate->SetReduction(reductFactor );

 
decimate->BoundaryVertexDeletionOn(); 

 
decimate->SetInputConnection(imageData->GetProducerPort()); 

                                                decimate->Update( );

 But at runtime I m getting the error as 

           "vtkGreedyTerrainDecimation (0x0032F2A0): This class treats 2D
height fields only" 

I am not getting the decimated triangles after the execution of
vtkGreedyTerrainDecimation algorithm.

Is there any problem with the flow? Do I need to convert the vtkImageData to
2D (height fields format) and if yes then how?

 

 

 Thanks in advance

Manoj

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060403/3fc47177/attachment.htm>


More information about the vtkusers mailing list