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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

David Cole-2
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

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

Reply | Threaded
Open this post in threaded view
|

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

Yumin Yuan
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 <[hidden email]> 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


_______________________________________________
Powered by www.kitware.com

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

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

Reply | Threaded
Open this post in threaded view
|

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

David Cole-2
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 <[hidden email]>
To: David Cole <[hidden email]>
Cc: vtk-developers <[hidden email]>; vtk-users
<[hidden email]>
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 <[hidden email]> 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




_______________________________________________
Powered by www.kitware.com

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

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