[vtk-developers] vtkVectorText -- to deprecate or not?

David Gobbi david.gobbi at gmail.com
Tue Oct 16 16:38:44 EDT 2012


The vtkAxisActor is the only code that I can see that would be high
priority for switching over to vtkTextActor3D.   The only other
classes that use vtkVectorText are vtkAnnotatedCubeActor, which
should probably continue to use vtkVectorText, and a few widgets:

vtkAbstractPolygonalHandleRepresentation3D.cxx
vtkAngleRepresentation3D.cxx
vtkAxesTransformRepresentation.cxx
vtkDistanceRepresentation3D.cxx
vtkLineRepresentation.cxx
vtkSliderRepresentation3D.cxx

The changes to the widgets should be OK'd by whoever is
using/maintaining those widgets.

Deprecating vtkVectorText would be going too far, because it does
something unique and useful, as noted by Bill.

 - David


On Tue, Oct 16, 2012 at 2:20 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> I guess the only advantage of vtkVectorText is that it is a source that
> produces polygonal letters. It can be used in a pipeline.
>
>
> On Tue, Oct 16, 2012 at 1:09 PM, David Lonie <david.lonie at kitware.com>
> wrote:
>>
>> Hi list,
>>
>> I'm writing an (optional) extension to VTK that will override
>> vtkTextActor with a "smart" math text actor that will switch between
>> FreeType rendering for plain text and MathText equation rendering for
>> strings containing MathText markup. The plan is to enable this in
>> ParaView, so that any visible text field in a RenderView will
>> automatically have the ability to display equations.
>>
>> To this end, I've added a vtkSmartMathTextActor and
>> vtkSmartMathTextActor3D, designed to be drop-in replacements for
>> vtkTextActor and vtkTextActor3D. Unfortunately, most of the 3D text
>> rendering in VTK/ParaView is done using vtkVectorText, which is quite
>> different from the other classes.
>>
>> While vtkTextActor3D is a stand-alone actor that uses FreeType to
>> generate a texture which is rendered to the device, vtkVectorText
>> derives from PolyDataAlgorithm and simply assembles hardcoded
>> polydata, character by character.
>>
>> I propose a long-term deprecation period for vtkVectorText, favoring
>> vtkTextActor3D, for the following reasons:
>>
>> * Limited supported character set:
>>     Only ascii codes 33-126 + '\n' are available
>> * Limited font support:
>>     Only a single hardcoded sans-serif font is available,
>>     while FreeType has at least serif, sans-serif, and monospace,
>>     as well as (optional) font config support for access to
>>     system fonts.
>> * No font properties:
>>     In addition to only a single font family, there is only one
>>     version of it. vtkVectorText doesn't know anything about
>>     vtkTextProperty, so bold, italics, justification, linespacing,
>>     etc, etc are fixed.
>> * Inflexible for providing custom implementations:
>>     Polydata output is quite unusual for a text layout engine,
>>     and producing such is difficult to re-implement.
>>
>> In short, there just doesn't seem to be much reason for keeping this
>> class around when there is a much more powerful, easier-to-use
>> alternative.
>>
>> While I think there is a strong argument for using vtkTextActor3D
>> instead of vtkVectorText, perhaps deprecating the class would be
>> overkill. In that case, I suggest encouraging new code to use the
>> vtkTextActor3D class, and to start refactoring existing classes (e.g.
>> vtkAxisActor, etc) to use vtkTextActor3D internally.
>>
>> Thoughts? Suggestions? Agreement? Disagreement?
>>
>> Dave
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>



More information about the vtk-developers mailing list