Below is a Python script which demonstrates a possible VTK culling bug.  It draws a cube and a
legend.  If you edit the script and uncomment the line which turns on
front face culling for the cube, the color bar of the legend will
disappear.  Am I misunderstanding something, or is the culling flag unintentionally affecting the 2D ScalarBarActor?  Sorry if this is an already fixed bug.<br><br>-- Lee Gross<br>Amoeba Technologies, Inc.<br><br>===================<br>
<br>#!/usr/bin/env python<br><br>import vtk<br><br># Create the usual rendering stuff<br>ren = vtk.vtkRenderer()<br>renWin = vtk.vtkRenderWindow()<br>renWin.AddRenderer(ren)<br>iren = vtk.vtkRenderWindowInteractor()<br>iren.SetRenderWindow(renWin)<br>
<br>istyle = vtk.vtkInteractorStyleSwitch()<br>iren.SetInteractorStyle(istyle)<br>istyle.SetCurrentStyleToTrackballCamera()<br><br># Create a legend<br>legend = vtk.vtkScalarBarActor()<br>legend.SetHeight(0.5)<br>legend.SetWidth(0.15)<br>
legend.SetPosition(0.8, 0.5)<br>lutDefault = vtk.vtkLookupTable()<br>nColors = 256<br>lutDefault.SetNumberOfColors(nColors)<br>lutDefault.SetTableRange(0., 1.)<br>lutDefault.Build()<br>legend.SetLookupTable(lutDefault)<br>

ren.AddActor(legend)<br><br>
# Create a box<br>box = vtk.vtkCubeSource()<br>mapper = vtk.vtkPolyDataMapper()<br>mapper.SetInput(box.GetOutput())<br>boxActor = vtk.vtkActor()<br><br># If this line is uncommented the legend&#39;s colors are not drawn<br>
#boxActor.GetProperty().FrontfaceCullingOn()<br>boxActor.SetMapper(mapper)<br><br># Add the actor to the renderer, set the background and size<br>ren.AddActor(boxActor)<br>ren.SetBackground(0.1, 0.2, 0.2)<br>renWin.SetSize(500, 500)<br>
ren.ResetCamera()<br>ren.ResetCameraClippingRange()<br><br>iren.Initialize()<br>renWin.Render()<br>iren.Start()<br><br>===================<br>
<br>