[vtk-developers] new vtkTextProperty class and changes

Sebastien BARRE sebastien.barre at kitware.com
Mon Jul 1 12:05:59 EDT 2002


At 7/1/2002 11:52 AM, Lisa Avila wrote:

>>The Color and Opacity attributes of the text are now controlled by the 
>>vtkTextProperty instead of the actor2D.
>>     Thus, instead of:
>>         actor->GetProperty()->SetColor(...)
>>         actor->GetProperty()->SetOpacity(...)
>>     you would do:
>>         actor->GetTextProperty()->SetColor(...)
>>         actor->GetTextProperty()->SetOpacity(...)
>
>This seems somewhat awkward since a 2D actor has both a GetProperty and a 
>GetTextProperty.

Sorry, that example was a bit confusing.
There is no vtkTextProperty in vtkActor2D.
Each time an actor (for example vtkTextActor, vtkXYPlotActor, 
vtkScalarBarActor, etc.) use text, it has one (or more) internal text 
property of its own, or it provides an accessor to an internal sub actor 
(for example, vtkXYPlotActor has GetLegendBoxActor() so that you can tweak 
the text property of its internal vtkLegendBoxActor).

Although all of these actors have vtkActor2D as parent, I did not put the 
vtkTextProperty in this parent, since it would be confusing (as you noticed).

In the previous example, actor is not a vtkActor2D per-say, but an instance 
of some of the actors listed above (vtkTextActor, vtkXYPlotActor, etc.). In 
the past, the actor's vtkProperty was used to control the color of the text 
as well of the color of the geometry, which could lead to hard-to-read 
results (for example, vtkParallelCoordinatesActor use the same color for 
the plot, the label, title, etc).


--
Sebastien Barre




More information about the vtk-developers mailing list