[vtkusers] vtkPanel.vtkPanel.GetRenderer().AddActor( vtkActor ) shows black surface (java wrapper)

Jonathan Ruiz Peinado jonathan.ruiz3 at gmail.com
Thu May 24 11:38:11 EDT 2012


Hi,  I've managed to get a custom slice from a volume using this example,
basically It's probing the volume with a custom surface.
http://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CurvedReformation

Now I'm trying to show this slice/surface in an vtkPanel but it's not
working as it should, I can see the surface  but it isn't textured at all
it's just black.

the code I'm using to do this is:
vtkPanel.GetRenderer().AddActor(
dicomViewer.getDicomImage().getActorCustomReslice(line_points) );

vtkPanel.GetRenderer().AddActor(new vtkLegendScaleActor());

vtkPanel.GetRenderer().GetActiveCamera().SetViewUp(0,0,1);
vtkPanel.GetRenderer().GetActiveCamera().SetPosition(0,0,0);
vtkPanel.GetRenderer().GetActiveCamera().SetFocalPoint(0,1,0);
vtkPanel.GetRenderer().ResetCamera();


If I use a regular vtkRenderWindow as I show below It shows me the surface
perfectly textured inside the render window
vtkRenderer renderer = new vtkRenderer();
vtkRenderWindow renderWindow = new vtkRenderWindow();

renderWindow.AddRenderer(renderer);
vtkRenderWindowInteractor renderWindowInteractor = new
vtkRenderWindowInteractor();
renderWindowInteractor.SetRenderWindow(renderWindow);

// Add the actors to the scene
renderer.AddActor(dicomViewer.getDicomImage().getActorCustomReslice(line_points));
renderer.SetBackground(.2, .3, .4);

// Set the camera for viewing medical images
renderer.GetActiveCamera().SetViewUp(0,0,1);
renderer.GetActiveCamera().SetPosition(0,0,0);
renderer.GetActiveCamera().SetFocalPoint(0,1,0);
renderer.ResetCamera();
renderWindow.Render();
renderWindowInteractor.Start();

I'm adding an vtkActor to the vtkPanel, It works fine when I add an
vtkImageActor. can it be the problem?  should i transform it to an
vtkImageActor some way? how?


Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120524/b0619a9a/attachment.htm>


More information about the vtkusers mailing list