[vtk-developers] Need to be able to supply custom scalar bar labels.

Jenya Burstein taijinian at gmail.com
Tue Jan 4 16:11:04 EST 2011


Hello,

I need to be able to display custom labels in vtkScalarBarWidget. Looking at
the code, it appears that I have the following options:
1) Subclass vtkScalarBarActor and re-implement the AllocateAndSizeLabels()
method. Not a very attractive option, as it will require copying the portion
of the method that sizes the actor verbatim from the base class;
2) Add a method to vtkScalarBarActor to supply vtkStringArray of labels. Not
a very attrative option either as it would require clients to re-supply the
array every time they change the look up table;
2) Add a method to vtkScalarBarActor to plug-in a strategy interface that
will be asked for a string for each label. This is probably the cleanest way
that will allow the most flexibility. However, I don't recall many places in
VTK that use the Strategy pattern.

I thought I'd ask for a guidance before I start down the path of changing
VTK one way or another.

Best Regards,
Jenya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110104/db7ed19e/attachment.html>


More information about the vtk-developers mailing list