[vtkusers] vtkScalarBarActor broken

Sebastien BARRE sebastien.barre at kitware.com
Mon Feb 17 09:48:59 EST 2003


At 2/17/2003 03:19 PM, Amy Henderson wrote:
>vtkScalarBarActor has a method called GetLabelTextProperty, and 
>vtkTextProperty has a method called SetFontSize, so do something like
>
>scalarBar->GetLabelTextProperty()->SetFontSize(newSize);
>
>(scalarBar is a vtkScalarBarActor and newSize is an integer specifying the 
>font size you want.)

No, you can't set the size like that.
If I'm not mistaken, even before text properties were added to scalarbar 
actor, there was no way to set the font size.
The reason is that vtkScalarbarActor is an Actor2D, and it honors its 
Position and Position2 coordinates, i.e. it will fit itself in the box 
described by those 2 points, like all Actor2D, and set the size of its text 
so that it fits inside this box.
Text properties have been added to share text styles between objects. The 
text property size attribute is ignored in vtkScalarBarActor.
I guess this class could be enhanced to allow text size to be modifed, but 
at the moment there are hard-coded values in the code that should be 
removed first (like the size that the bar itself takes within the box, 
which leads to the space remaining for the text, which constrains the text 
size, etc.).


--
Sebastien Barre





More information about the vtkusers mailing list