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

David Cole dlrdave at aol.com
Fri Mar 14 14:29:03 EDT 2014


Thanks -- I just tried it with build I made of 6.1 as well, and lo and 
behold -- it works now. Serves me right: I should know better than to 
ask on the list before trying with the latest release and master...

Problem solved.

The reason there is no need for an OpenGL-specific vtkProperty2D 
override, is GetColor is called directly by the PolyData2DMapper to set 
up the color prior to rendering. Presumably all other relevant 
attributes of vtkProperty2D are similarly handled directly as needed.


Thanks, Yumin!

D



-----Original Message-----
From: Yumin Yuan <yumin.yuan at kitware.com>
To: David Cole <dlrdave at aol.com>
Cc: vtk-developers <vtk-developers at vtk.org>; vtk-users 
<vtkusers at vtk.org>
Sent: Fri, Mar 14, 2014 12:19 pm
Subject: Re: [vtkusers] vtkProperty2D problem: SetLineColor has no 
effect when used on the border widget's property


Hi Dave,


I tried the example with 6.1 and master on OSX 10.8, and both seem to 
work for me. Haven't tried 6.0 though.


HTH,
Yumin




On Thu, Mar 13, 2014 at 8:40 AM, David Cole <dlrdave at aol.com> wrote:

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.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: 
http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers







More information about the vtk-developers mailing list