[vtkusers] Scalar bar

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Wed May 30 08:52:42 EDT 2001


Matthieu,

>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 wonder if its the same for all platforms? Anyone know?

My advice would be to tweak as many bits as you think appropriate so that 
the scalar bar looks better, if nobody objects, we can check in the changes 
to the main vtk distribution.
If you can make the labels come out in the correct place and at 10,20,30,40 
instead of 10.56, 20.89, 31.04 by adding a suitable flag (or flags), then 
I'll vote for it. The secret is to make changes, but ensure that the 
default action makes it look pretty much as it does now, users can set a 
flag to make it better. That way it only impacts people if they want it. If 
it looks a bit different, I will sort out the regression test images etc 
etc (assuming there are no objections to changes).

Anyone else want to chip in with suggestions ...

JB


At 13:25 30/05/2001, Matthieu Ferrant wrote:
>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





More information about the vtkusers mailing list