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

David Lonie david.lonie at kitware.com
Tue Nov 17 09:28:41 EST 2015


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/vtk-developers/attachments/20151117/83932a86/attachment-0001.html>


More information about the vtk-developers mailing list