Absolute coordinate and world coordinate

Hi,

I am trying to understand better the coordinate systems used in ROOT, so that I can read and understand the implementations for zooming.

In the manual, I can see the definitions of three coordinate systems:

  1. User coordinate system
  2. NDC coordinate system
  3. Pixel coordinate system

However, when I try to read the source for TPad, I see two other coordinate systems used:

AbsolutePixel (AbsPixel) and World coordinate system.

I think the world-coordinates actually means the user-coordinates,
but I can’t figure the difference between Absolute Pixel and Pixel.

Please help me to find the definitions for “absolute pixel coordinate” and “world coordinate”.

When is Absolute pixel coordinate used?

Thanks


for example, one inline method in TPad.h

inline Double_t TPad::PixeltoX(Int_t px)
{
if (fAbsCoord) return fAbsPixeltoXk + pxfPixeltoX;
else return fPixeltoXk + px
fPixeltoX;
}

The diffierence is the pxlow factor:

  fXtoAbsPixelk = rounding + pxlow - pxrange*fX1/xrange;   
  fXtoPixelk = rounding +  -pxrange*fX1/xrange;

Which is computed as follow:

  Double_t wh = (Double_t)gPad->GetWh();
  Double_t pxlow   = fAbsXlowNDC*ww;

fAbsXlowNDC is nul in case of a single pad but is not in case of multiple pads (Divide()). So you should one method or the other depending if you want to convert in pixels in “Canvas pixel coordinates” or in the current “pad pixel coordinates”. I would suggest you create a canvas with multiple subpads and make yourself some tries to understand the difference.

[quote=“timtran”]Hi,
I am trying to understand better the coordinate systems used in ROOT, so that I can read and understand the implementations for zooming.
[/quote]Please check the TQtZoomPadWidget
root.bnl.gov/QtRoot/htmldoc/TQtZ … escription

The source code is not provided via Web interface yet. You may want to see it the “plain” format
root.bnl.gov/QtRoot/root/qtgui/s … Widget.cxx

Pay your attention to the method:
TQtZoomPadWidget::SetPad(TVirtualPad *pad,bool tobeShown )
there.