[vtkusers] vtkProperty2D problem: SetLineColor has no effect when used on the border widget's property

David Cole dlrdave at aol.com
Thu Mar 13 08:40:06 EDT 2014


In this example: 
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ImageClip

This line of code apparently works:

static_cast<vtkBorderRepresentation*>
     
(borderWidget->GetRepresentation())->GetBorderProperty()->SetColor(0,1,0)
;

and makes the border widget green.

If I add the exact same line of code to this example: 
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/BorderWidget

it has no apparent effect, and the border widget stubbornly remains 
exactly white.

Why???

I stepped through the code in the debugger, and see that 
vtkProperty2D::Render gets called, and it is a no-op... expecting to 
have a vtkOpenGLProperty2D override, I presume. But there isn't one.

So I understand why it *doesn't* work in the border widget example. So 
why does it work in the image clip example??? I don't get it...

This is all with VTK somewhere between 6.0 and 6.1 (I can be more exact 
if necessary, or try 6.1 if somebody claims it's fixed in there), using 
ninja and the VS 2012 compiler on Windows.


Thanks,
David C.



More information about the vtkusers mailing list