[vtkusers] Problems porting from Python to C++

Lucas Peetz Dulley dulley at lsi.usp.br
Sun Sep 21 04:20:37 EDT 2003


Using Python I did some testings before I went to the C++ version of my 
code.
 But, for my surprise , I got some type checking problems... :(

Here are the codes:

/Python:

(...)
dem = vtk.vtkVolume16Reader()
dem.SetDataDimensions(480, 600)
dem.SetDataByteOrderToLittleEndian()
dem.SetFilePrefix("brasil")
dem.SetDataSpacing(1000, 1000, 10)

geometry = vtk.vtkImageDataGeometryFilter()
geometry.SetInput(dem.GetOutput())

warp = vtk.vtkWarpScalar()
warp.SetInput(geometry.GetOutput())
warp.SetScaleFactor(1)
(...)

C++:

(...)
vtkVolume16Reader *dem = vtkVolume16Reader::New();
    dem->SetDataDimensions(480, 600);
    dem->SetDataByteOrderToLittleEndian();
    dem->SetFilePrefix("brasil");
    dem->SetDataSpacing(1000, 1000, 10);

vtkImageDataGeometryFilter *geometry = vtkImageDataGeometryFilter::New();
    geometry->SetInput(dem->GetOutput());

vtkWarpScalar *warp = vtkWarpScalar::New();
        warp->SetInput(geometry->GetOutput());     // I get the error 
here!!!!
        warp->SetScaleFactor(1);
(...)/

This is the error I get:

main.cc:33: no matching function for call to 
`vtkWarpScalar::SetInput(vtkPolyData*)'
/usr/local/include/vtk/vtkPointSetToPointSetFilter.h:57: candidates are: 
void
   vtkPointSetToPointSetFilter::SetInput(vtkPointSet*)

In all the examples (python or tcl) you can get the output from the 
"vtkImageDataGeometryFilter" and set it as the input to "vtkWarpScalar".
But when I did it using C++ I got the error above.

Please, can anyone tell me what's wrong? ... I am stuck.
Any suggestions are more than welcome!!!! :)

Thanks for you time and patience,

Lucas

-- 
Lucas Peetz Dulley   <dulley at lsi.usp.br>
Homepage: http://www.lsi.usp.br/~dulley/
Virtual Reality Center - CAVERNA Digital
LSI - POLI - USP   Tel: +55-11-3091-5374
Av. Prof. Luciano Gualberto, 158 trav. 3
CEP: 05508-900 - Sao Paulo - SP - Brazil 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030921/36a2cf82/attachment.htm>


More information about the vtkusers mailing list