[vtkusers] Problem of vtkPolyDataToImageStencil
Mathieu Malaterre
mathieu.malaterre at kitware.com
Mon Mar 22 17:43:38 EST 2004
Yan,
Did you read the documentation of vtkPolyDataToImageStencil ? My guess
is that you are trying to display an image stencil. Please read :
http://www.vtk.org/doc/nightly/html/classvtkPolyDataToImageStencil.html
And an example is always eaiser to understand:
http://vtk.org/cgi-bin/cvsweb.cgi/~checkout~/VTK/Hybrid/Testing/Tcl/TestImageStencilWithPolydata.tcl
HTH
Mathieu
Yan Pingkun wrote:
> Hi all,
>
> I'm using vtkPolyDataToImageStencil in my project. I run the TCL text
> program. It is OK except the recently reported bug.
>
> But when I wrote program in C++, the filter can't work. My code is as
> follows:
>
> ========================================================
> vtkSphereSource* sphere = vtkSphereSource::New();
> sphere->SetPhiResolution(12);
> sphere->SetThetaResolution(12);
> sphere->SetCenter(48, 48, 48);
> sphere->SetRadius(5);
>
> vtkPolyDataToImageStencil* Poly2Stencil = vtkPolyDataToImageStencil::New();
> Poly2Stencil->SetInput(sphere->GetOutput());
> Poly2Stencil->Update();
> const vtkImageStencilData* stencilData = Poly2Stencil->GetOutput();
> ========================================================
>
> When I debug the program, I found that the extent of stencilData is
> always -1, which causes the program crash.
> Anybody can help? I'm working under Windows XP with MSVC 6.
>
> Thanks!
>
> Regards,
> Pingkun
More information about the vtkusers
mailing list