[vtkusers] 2D view of vtkCutter output (of 3D volume)

Tijmen Klein T.R.Klein at student.rug.nl
Mon Sep 19 05:11:22 EDT 2011


Hello everyone,

I have a 3D scene with volumetric data, where the user can place a cutting
plane. Normally this cutting plane is applied to the volume, so that a part
of the volume is cut away. This looks something like this:

volumeMapper = vtkSmartPointer<vtkGPUVolumeRayCastMapper>::New();
volumeMapper->AddClippingPlane(clipPlane);
volumeMapper->SetInputConnection(reader->GetOutputPort());

So I have the following pipeline: vtkStructuredPointsReader
-> vtkGPUVolumeRayCastMapper -> vtkVolume

Now, as an alternative representation I want to add a 2D view of the cutting
plane, and let this fill the whole renderer. I am able to get a 2D
representation, but the display stays very small.
For this I use the pipeline: vtkStructuredPointsReader -> vtkCutter
-> vtkPolyDataMapper2D -> vtkActor2D

In order to let the vtkActor2D cover the whole renderer, I tried this:

cutActor->GetPositionCoordinate()
->SetCoordinateSystemToNormalizedViewport();
cutActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
cutActor->SetPosition(0.0, 0.0);
cutActor->SetPosition2(1.0, 1.0);

The setPosition() call seems to work ( I can move the 2D cut around), but
the setPosition2() seems to be doing nothing. No matter what values I use,
the 2D representation always stays the same size.

Am I going in the right direction for displaying something like this? If so,
how can I adjust it so that 2D actor gets larger? If it's not the way to go,
are there other ways to solve this problem?
To visualize the problem, I've upload a screenshot that shows what is going
wrong: http://dl.dropbox.com/u/27566470/2dview.png Here you can see the
standard 3D view and the very small 2D view of the cut.

Cheers,
Tijmen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110919/5e85b126/attachment.htm>


More information about the vtkusers mailing list