[vtk-developers] vtkBoxRepresentation outline color

Chris Harris chris.harris at kitware.com
Thu Oct 20 15:06:37 EDT 2016


We are using vtkBoxRepresentation in tomviz to perform cropping. The
outline color defaults to white, which is not so good for a white
background! So we are trying to set it to an off white (0.8, 0.8, 0.8)
However, the value gets rendered as white? What am I missing? Here is the
python code to recreate this issue

import vtk

ren = vtk.vtkRenderer()
ren.SetBackground(1,1,1)

renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)

iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)

boxRep = vtk.vtkBoxRepresentation()
boxRep.SetPlaceFactor(1.0)
boxRep.HandlesOn()
boxRep.GetOutlineProperty().SetColor(0.8, 0.8, 0.8)

boxWidget = vtk.vtkBoxWidget2()
boxWidget.SetInteractor(iren)
boxWidget.SetRepresentation(boxRep)
boxWidget.SetPriority(1)
boxWidget.On()

iren.Initialize()
renWin.Render()
iren.Start()


Thanks,

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20161020/3c87145f/attachment.html>


More information about the vtk-developers mailing list