[vtkusers] vtkTextMapper Disable Resize

Slaughter, Andrew E andrew.slaughter at inl.gov
Wed Oct 14 10:29:15 EDT 2015


Attached an example that produces the un-wanted behavior on my machine (VTK
6.3, python bindings), perhaps I am just doing something incorrectly. I
also attached a few rendered windows that show the problem.

Thanks for you quick reply,

Andrew

On Wed, Oct 14, 2015 at 6:18 AM, David Lonie <david.lonie at kitware.com>
wrote:

> 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/b2f78c2e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: annotation.py
Type: text/x-python-script
Size: 1273 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151014/b2f78c2e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: annotation_0.png
Type: image/png
Size: 1693 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151014/b2f78c2e/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: annotation_3.png
Type: image/png
Size: 1733 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151014/b2f78c2e/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: annotation_4.png
Type: image/png
Size: 1993 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151014/b2f78c2e/attachment-0002.png>


More information about the vtkusers mailing list