[vtkusers] vtkAxesActor does not display its labels if it is added to a vtkAssembly.

Barth, Sebastian sebastian.barth at iosb.fraunhofer.de
Mon Aug 23 04:58:17 EDT 2010


Hello vtkusers,

I've worked out a problem with the vtkAxesActor and vtkAssembly. I've used the following example for testing.

The problem is, that the axis labels will not be displayed if the actor is added to a vtkAssembly. The curious is that the labels will be displayed if you use a vtkPropAssembly instead of a vtkAssembly.

Is this a bug? Can you confirm it?


    vtkAxesActor * axesActor = vtkAxesActor::New();
    axesActor->SetAxisLabels(true);
    axesActor->SetXAxisLabelText("x");
    axesActor->SetYAxisLabelText("y");
    axesActor->SetZAxisLabelText("z");
	
    vtkPropAssembly * assembly = vtkPropAssembly::New();
    assembly->AddPart(axesActor);
    
    vtkRenderer * ren = vtkRenderer::New();
    vtkRenderWindow * renWin = vtkRenderWindow::New();
    renWin->AddRenderer(ren);
    vtkRenderWindowInteractor * iren = vtkRenderWindowInteractor::New();
    iren->SetRenderWindow(renWin);

    ren->AddActor(assembly);
    ren->ResetCamera();
    renWin->Render();
    iren->Start();


Thanks a lot for your help!

Best Regards,

Sebastian Barth



More information about the vtkusers mailing list