Extracted cross-section from vtkCutter cannot be displayed
I am trying to extract the cross-section of a sphere (vtkSphereSource)
displayed in one render window, and display its cross-section in another
render window, however, I am unable to make this work. I am trying to
achieve this using a vtkCutter to extract the cross-section of
I have adapted the SideBySideRenderWindowsQt example from the wiki to
demonstrate the problem. The full compileable code is attached.
Here are some details of the problem:
In the example, I have two views: 1) left "2D" view and 2) right "3D" view.
The 2D view has a callback for picking points via the ALT+LeftMouseButton
key combination. When the user picks a point on the 2D view, the
addPickedPoint() method is called, which renders a sphere on the 3D view and
then uses a vtkCutter to extract the cross-section of the sphere so that it
is displayed at the position of the picked point on the 2D view. The
attached code implements this behaviour, however, only the sphere appears on
the 3D view. Its cross-section, extracted using a vtkCutter instance is not
displayed on the 2D view. My initial thought was that the vtkImageStack on
the 2D view is "hiding" the cross-section actor, but after removing the
vtkImageStack the actor is still not displayed.
// actor for displaying sphere in 3D
sphereActor->GetProperty()->SetDiffuseColor(1, 0, 0);
// setup cut plane for extracting cross-sections of polygonal models.
// Cutplane is the plane defined by the focal point and the view plane
// normal of the Left View.
// actor for displaying the extracted cross-section from the sphere
cutterActor->GetProperty()->SetDiffuseColor(0.2, .49, 1);
cutterActor->GetProperty()->SetColor(1.0, 0.55, 0.2);
// add all actors to the Renderers
// reset camera