[vtkusers] simple ray cast in c++, what's the problem?

Francois Bertel francois.bertel at kitware.com
Tue Jun 26 09:02:51 EDT 2007


Hi 한종철,

Add this at the top of your source file:
#include "vtkStructuredPoints.h"

Explanation here:
http://www.vtk.org/Wiki/VTK_FAQ#The_C.2B.2B_compiler_cannot_convert_some_pointer_type_to_another_pointer_type_in_my_little_program

한종철 wrote:
> hi all,
> 
> I'm studying the vtk .
> 
> This is simple c++ source of volume rendering from the book .
> 
>  
> 
>     this->opacityTransferFunction->AddPoint(2.0,0.0);
>     this->opacityTransferFunction->AddPoint(255,0.2);
> 
>     this->colorTransferFunction->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
>     this->colorTransferFunction->AddRGBPoint(64.0,1.0,0.0,0.0);
>     this->colorTransferFunction->AddRGBPoint(128.0,0.0,0.0,1.0);
>     this->colorTransferFunction->AddRGBPoint(192.0,0.0,1.0,0.0);
>     this->colorTransferFunction->AddRGBPoint(255.0,0.0,0.2,0.0);
> 
>     this->volumeProperty->SetColor(colorTransferFunction);
>     this->volumeProperty->SetScalarOpacity(opacityTransferFunction);
> 
>     this->volumeMapper -> SetVolumeRayCastFunction(compositeFunction);
>   
>    
> 
>    * this->volumeMapper -> SetInput(this->Reader->GetOutput());*
> 
>     this->volume->SetMapper(volumeMapper);
>     this->volume->SetProperty(volumeProperty);
> 
>  
> 
> C:\Documents and Settings\All Users\바탕 화면\vtkSDI\vtkSDIDoc.cpp(209)
> : error C2664: 'void __thiscall vtkVolumeMapper::SetInput(class
> vtkImageData *)' : cannot convert parameter 1 from 'class
> vtkStructuredPoints *' to 'class vtkImageData *'
> 
>  
> 
>  
> 
> I got this problem!!
> 
> What's the problem? Can you help me?
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers


-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list