[vtkusers] [vtk-developers] Mix of TextMapper color and Actor2d color broken

Xabi Riobe xabivtk at gmail.com
Tue Nov 17 09:56:29 EST 2015


It's ok for me as i now also ensure to set the color only to the text
property, but the red+green=black situation seems to be a bug somewhere in
the vtk code.

A usecase can be:
first take a global preference for color text that you apply to the text
property, then if the actor is "packaged" with other ones as a group and
you change the color of the group, the color is set to all the actors
properties without knowing if there are text related or not.

In this scenario we can think that the actor property should have the
priority, but i am sure we can think of another one that states the
opposite.

So in my opinion, if anything is to be modified, i would choose what makes
more sense according to the implementation of the final coloring...

Xabi

2015-11-17 15:28 GMT+01:00 David Lonie <david.lonie at kitware.com>:

> On Tue, Nov 17, 2015 at 7:37 AM, Xabi Riobe <xabivtk at gmail.com> wrote:
>
>> Hi,
>>
>> There is an issue when
>> combining vtkTextMapper->GetTextProperty()->SetColor and
>> vtkActor2D->GetProperty()->SetColor
>>
>> Before digging into what causes the issue, i would like to know what is
>> the expected result?
>>
>> here are different behaviours when setting a vtkTextMapper to a
>> vtkActor2D:
>>
>> with VTK 5.10 :
>>
>> TextProperty RED + ActorProperty WHITE => Text RED
>> TextProperty WHITE + ActorProperty GREEN => Text WHITE
>> TextProperty RED + ActorProperty GREEN => Text RED
>>
>> with VTK 6.3 and master, OpenGL 1&2:
>>
>> TextProperty RED + ActorProperty WHITE => Text RED
>> TextProperty WHITE + ActorProperty GREEN => Text GREEN
>> TextProperty RED + ActorProperty GREEN => Text BLACK
>>
>> with vtk 5.10, the vtkTextProperty has always priority, whereas with
>> newer versions if only one color is set it is taken into acount, with an
>> obvious issue when both of them are set.
>>
>
> I'm not sure this was ever well defined behavior, but someone can correct
> me if I'm wrong. I've typically followed the rule of always setting the
> color on the text property and leaving the actor color untouched. This
> should always yield the intended result of rendering the text property's
> color.
>
> I can't think of a usecase off the top of my head where setting both would
> have any meaningful utility. If there are any such usages, we should use
> those to determine what the "correct" behavior would be.
>
> Dave
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151117/cafbb357/attachment.html>


More information about the vtkusers mailing list