[vtkusers] Scalar bar
Matthieu Ferrant
ferrant at tele.ucl.ac.be
Wed May 30 08:25:58 EDT 2001
hi,
I found the line where the textactors are placed along hte scalar bar.
It is in vtkScalarBarActor.cxx, line 371 (in my version of VTK) :
this->TextActors[i]->SetPosition(barWidth+3,
val - sizeTextData[1]/2);
val is the corresponding value on the scalar bar.
this means the text is shifted down half of its height, but it doesn't
look like that. If you change the offset to sizeTextData[1]/4 it looks
better for a vertical scalar bar. I determined this quite heuristically,
I can't say why /2 is wrong. May be there's a problem with the
computation of sizeTextData. Attached is the same bar as before but with
the /4 shift.
matt
John Biddiscombe wrote:
>
> >the first value is always displayed below the scalar bar, it's almost as
>
> Probably the text is being displayed with vertical alignment on the top
> left. Inside the scalar bar code, there are text mappers, one for each
> label, created inside a loop. Probably if you examine the code (I don't
> know it well enough to advise any better), you can find something that
> looks suspicious. Unfortunately, unless you are willing to dig deep into
> the code and do some reworking, there isn't much chance it'll get improved
> in the short term! (A bit of work might be enough to tidy up the labels and
> add some "clever" choice over the label formatting etc...)
>
> ttfn
>
> JB
--
M.Ferrant, Ph.D.
UCL/TELE Room A-157 Place du Levant, 2 B-1348LLN - Belgium
Tel. +32-10-478073 Fax. : +32-10-472089
http://www.tele.ucl.ac.be/MEMBERS/Ferrant_Matthieu_e.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scalbar.gif
Type: image/gif
Size: 4009 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20010530/a44aa287/attachment.gif>
More information about the vtkusers
mailing list