libpgplotxx.a (C++ interface to PGPLOT)

◆ setup()

void pgplot::Ttiledpanels::setup ( const Trect svp,
const Trect win,
const int &  nx,
const int &  ny 
)
private

function used by constructors

class Ttiledpanels

Definition at line 128 of file xpgplotxx.cc.

References pgplot::Trange::max, pgplot::Trange::min, Mnx, Mny, Mpanels, Mvp, pgplot::Tpanel::settvp(), pgplot::Tpanel::setvp(), pgplot::Tpanel::setwin(), pgplot::Trect::x, and pgplot::Trect::y.

Referenced by Ttiledpanels().

130  {
131  Mnx=(nx>0 ? nx : 1);
132  Mny=(ny>0 ? ny : 1);
133 
134  float dx=(Mvp.x.max-Mvp.x.min)/Mnx;
135  float dy=(Mvp.y.max-Mvp.y.min)/Mny;
136 
137  Mpanels=new Tpanel[Mny*Mnx];
138  for (int i=0; i<Mnx; i++)
139  {
140  for (int j=0; j<Mny; j++)
141  {
142  Tpanel& panel=Mpanels[i+j*Mnx];
143  panel.setwin(win);
144  panel.settvp(Trect(Mvp.x.min+i*dx,
145  Mvp.x.min+(i+1)*dx,
146  Mvp.y.min+j*dy,
147  Mvp.y.min+(j+1)*dy));
148  panel.setvp(svp);
149  }
150  }
151  }
Tpanel & setwin(const Trect &win)
set world coordinates
Definition: xpgplotxx.h:185
int Mnx
number of subpanels
Definition: xpgplotxx.h:293
Trange x
coordinate ranges
Definition: structs.h:132
Tpanel * Mpanels
array of subpanels
Definition: xpgplotxx.h:295
Tpanel & setvp(const Trect &vp)
set viewport relative to total viewport
Definition: xpgplotxx.h:179
Trange y
Definition: structs.h:132
float min
range [min....max]
Definition: structs.h:44
float max
Definition: structs.h:44
Trect Mvp
the total view surface area
Definition: xpgplotxx.h:291
Tpanel & settvp(const Trect &tvp)
set total viewport relative to device surface
Definition: xpgplotxx.h:182
Here is the call graph for this function:
Here is the caller graph for this function: