[vtkusers] vtkTextMapper Disable Resize
David Lonie
david.lonie at kitware.com
Wed Oct 14 08:18:40 EDT 2015
On Tue, Oct 13, 2015 at 6:39 PM, Slaughter, Andrew E <
andrew.slaughter at inl.gov> wrote:
> I am using a vtkTextMapper to display a floating point number, this number
> is updated with time and varies between integer values and decimal values.
>
> When I first create the text, it has an integer value. This seems to set
> the extent of the text, because at subsequent times the decimal numbers are
> compressed horizontally to that that text fits within the same extents. I
> am simply calling vtkTextMapper.SetInput('new text here') at each timestep.
>
> Is there a way to update the extents to allow the font-size to remain
> constant, or set the extents manually at the beginning to be larger than
> the first text string?
>
The vtkTextMapper / vtkActor2D combo should behave as you describe: It
should always use the font size to determine the size of the rendered text
and set the extents from that. As the input string changes, the extents
should change to contain the rendered text at the specified font size.
I've tried to reproduce the buggy behavior you mention, but cannot -- the
text extents change appropriately as the input changes. Are there any
additional options set on the mapper/actor? Can you provide a minimal code
example the reproduces this behavior?
Also, what version of VTK is this?
Thanks,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151014/d187f503/attachment.html>
More information about the vtkusers
mailing list