[vtkusers] Problems porting from Python to C++

Ketan Mehta ketan.mehta at wipro.com
Sun Sep 21 05:03:29 EDT 2003


Hi Lucas,

I have also faced similar problems in tcl examples.
There are mainly due to strong type checking in C++.

Check whether
1) You have included vtkWarpScaler.h in code.
2) try to type case it, but not sure whether it is proper here.

bye
Ketan

> Lucas Peetz Dulley wrote:
> 
> 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

**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***************************************************************************



More information about the vtkusers mailing list