20 #ifndef TF_PGPLOTBASICDEVICE_H_VERSION 22 #define TF_PGPLOTBASICDEVICE_H_VERSION \ 23 "TF_BASICDEVICE_H V1.0 (17-03-2015)" 74 const float& x2,
const float& y2)
75 { this->
select(); cpgarro(x1, y1, x2, y2);
return(*
this); }
78 { this->
select(); cpgask(flag);
return(*
this); }
81 { this->
select(); cpgask(flag);
return(*
this); }
84 const float& x2,
const float& y2,
const float& v1,
85 const float& v2,
const float& step,
86 const int& nsub,
const float& dmajl,
87 const float& dmajr,
const float& fmin,
88 const float& disp,
const float& orient)
91 cpgaxis(opt, x1, y1, x2, y2, v1, v2, step, nsub,
92 dmajl, dmajr, fmin, disp, orient);
97 const Trange& val,
const float& step=0.,
98 const int& nsub=0,
const float& dmajl=0.01,
99 const float& dmajr=0.01,
const float& fmin=0.3,
100 const float& disp=0.05,
const float& orient=0.)
103 val.
min, val.
max, step, nsub, dmajl, dmajr, fmin,
108 { this->
select(); cpgbbuf();
return(*
this); }
111 const Logical& center)
112 { this->
select(); cpgbin(nbin, x, data, center);
return(*
this); }
115 const char *yopt,
float ytick,
int nysub)
118 cpgbox(xopt, xtick, nxsub, yopt, ytick, nysub);
146 { this->
select(); cpgdraw(x, y);
return(*
this); }
151 { this->
select(); cpgebuf();
return(*
this); }
154 const float &ymin,
const float &ymax,
155 const int &just=0,
const int &
axis=0)
158 cpgenv(xmin, xmax, ymin, ymax, just,
axis);
163 const int &just=0,
const int &
axis=0)
170 { this->
select(); cpgeras();
return(*
this); }
173 const float& y,
const float& e,
175 { this->
select(); cpgerr1(dir, x, y, e ,t);
return(*
this); }
189 int i1,
int i2,
int j1,
int j2,
190 float fg,
float bg,
const float *tr)
193 cpggray(a, idim, jdim, i1, i2, j1, j2, fg, bg, tr);
212 { this->
select(); cpglab(xlbl, ylbl, toplbl);
return(*
this); }
219 { this->
select(); cpgline(n, xpts, ypts);
return(*
this); }
222 { this->
select(); cpgmove(x, y);
return(*
this); }
227 const float& fjust,
const char *text)
230 cpgmtxt(side, disp, coord, fjust, text);
239 { this->
select(); cpgpage();
return(*
this); }
242 { this->
select(); cpgpanl(nxc, nyc);
return(*
this); }
254 { this->
select(); cpgpoly(n, xpts, ypts);
return(*
this); }
257 { this->
select(); cpgpt(n, xpts, ypts, symbol);
return(*
this); }
260 { this->
select(); cpgpt1(xpt, ypt, symbol);
return(*
this); }
263 const float& angle,
const float& fjust,
265 { this->
select(); cpgptxt(x, y, angle, fjust, text);
return(*
this); }
293 { this->
select(); cpgqcr(ci, cr, cg, cb);
return(*
this); }
323 const float& fjust,
const char *text,
324 float *xbox,
float *ybox)
327 cpgqtxt(x, y, angle, fjust, text, xbox, ybox);
332 const float& fjust,
const char *text,
Tbbox& b)
334 float xbox[4], ybox[4];
335 this->
qtxt(x, y, angle, fjust, text, xbox, ybox);
349 cpgqwin(x1, x2, y1, y2);
354 {
return(this->
qwin(&x1, &x2, &y1, &y2)); }
359 this->
qwin(x1, x2, y1, y2);
372 const float& y1,
const float& y2)
373 { this->
select(); cpgrect(x1, x2, y1, y2);
return(*
this); }
390 basic_device&
sah(
const int& fs,
const float& angle,
const float& barb)
392 { this->
select(); cpgsah(fs, angle, barb);
return(*
this); }
395 { this->
select(); cpgsave();
return(*
this); }
398 { this->
select(); cpgunsa();
return(*
this); }
401 { this->
select(); cpgscf(font);
return(*
this); }
404 { this->
select(); cpgsch(size);
return(*
this); }
407 { this->
select(); cpgsci(ci);
return(*
this); }
410 { this->
select(); cpgscir(icilo, icihi);
return(*
this); }
413 { this->
select(); cpgsclp(state);
return(*
this); }
416 const float& cg,
const float& cb)
417 { this->
select(); cpgscr(ci, cr, cg, cb);
return(*
this); }
420 {
return(this->
scr(ci, rgb.
r, rgb.
g, rgb.
b)); }
429 { this->
select(); cpgsfs(fs);
return(*
this); }
433 { this->
select(); cpgshls(ci, ch, cl, cs);
return(*
this); }
436 {
return(this->
shls(ci, hls.
h, hls.
l, hls.
s)); }
440 { this->
select(); cpgshs(angle, sepn, phase);
return(*
this); }
443 { this->
select(); cpgsitf(itf);
return(*
this); }
446 { this->
select(); cpgsls(ls);
return(*
this); }
449 { this->
select(); cpgslw(lw);
return(*
this); }
452 { this->
select(); cpgstbg(tbci);
return(*
this); }
455 { this->
select(); cpgsubp(nxsub, nysub);
return(*
this); }
458 const float& ybot,
const float& ytop)
461 cpgsvp(xleft, xright, ybot, ytop);
469 const float& y1,
const float& y2)
472 cpgswin(x1, x2, y1, y2);
487 const char *yopt,
float ytick,
int nysub)
490 cpgtbox(xopt, xtick, nxsub, yopt, ytick, nysub);
503 { this->
select(); cpgupdt();
return(*
this); }
512 const float& ybot,
const float& ytop)
513 { this->
select(); cpgvsiz(xleft, xright, ybot, ytop);
return(*
this); }
519 { this->
select(); cpgvstd();
return(*
this); }
522 const float& disp,
const float& width,
523 const float& fg,
const float& bg,
527 cpgwedg(side, disp, width, fg, bg, label);
532 const float& disp,
const float& width,
535 {
return(this->
wedg(side, disp, width, range.
min, range.
max, label)); }
538 const char *label=
"value",
539 const float& disp=0.3,
540 const float& width=3.0,
541 const char *side=
"RG")
542 {
return(this->
wedg(side, disp, width, range.
min, range.
max, label)); }
545 const float& y1,
const float& y2)
546 { this->
select(); cpgwnad(x1, x2, y1, y2);
return(*
this); }
559 static float rnd(
const float& x,
int *nsub)
561 {
return(cpgrnd(x, nsub)); }
566 static void rnge(
const float& x1,
const float& x2,
float *xlo,
float *xhi)
567 { cpgrnge(x1, x2, xlo, xhi); }
586 int band(
const int& mode,
const int& posn,
587 const float& xref,
const float& yref,
float *x,
float *y,
591 return(cpgband(mode, posn, xref, yref, x, y, ch_scalar));
593 int curs(
float *x,
float *y,
char *ch_scalar)
596 return(cpgcurs(x, y, ch_scalar));
599 { this->
select(); cpglcur(maxpt, npt, x, y);
return(*
this); }
601 { this->
select(); cpgncur(maxpt, npt, x, y, symbol);
return(*
this); }
603 { this->
select(); cpgolin(maxpt, npt, x, y, symbol);
return(*
this); }
615 #endif // TF_PGPLOTBASICDEVICE_H_VERSION (includeguard) int band(const int &mode, const int &posn, const float &xref, const float &yref, float *x, float *y, char *ch_scalar)
basic_device & bbuf(void)
start buffering
~basic_device()
destructor closes PGPLOT device
basic_device & eras(void)
erase total panel
basic_device & qwin(float *x1, float *x2, float *y1, float *y2)
inquire window boundary coordinates
basic_device & olin(int maxpt, int *npt, float *x, float *y, int symbol)
provide useful structs for pgplotxx (prototypes)
basic_device & env(const Trect rect, const int &just=0, const int &axis=0)
define PGPLOT window and axis
basic_device & page()
advance to next output page
basic_device & scir(const int &icilo, const int &icihi)
set color index range
contains all pgplot stuff
hold bounding box for text etc.
basic_device & sci(const int &ci)
set color index
basic_device & draw(const float &x, const float &y)
draw line to position
basic_device & save(void)
save device settings
basic_device & vsiz(const float &xleft, const float &xright, const float &ybot, const float &ytop)
set viewport (view area - here: in inches)
basic_device & move(const float &x, const float &y)
move plot position
basic_device & sitf(const int &itf)
set image transfer function
basic_device & pt(int n, const float *xpts, const float *ypts, int symbol)
draw a sequence of marker symbols
basic_device & vstd(void)
select standard viewport
basic_device & swin(const float &x1, const float &x2, const float &y1, const float &y2)
set window (world coordinate range)
basic_device & ask(const bool &flag=true)
ask before clearing page? (bool version)
basic_device & shs(const float &angle, const float &sepn, const float &phase)
set hatching style
basic_device & bin(const int &nbin, const float *x, const float *data, const Logical ¢er)
plot binning
basic_device & stbg(const int &tbci)
set background color index
basic_device & qtxt(const float &x, const float &y, const float &angle, const float &fjust, const char *text, float *xbox, float *ybox)
get bounding box of text
basic_device & scr(const int &ci, const float &cr, const float &cg, const float &cb)
set color representation
basic_device & svp(const Trect &vp)
set viewport (view area)
basic_device & panl(int nxc, int nyc)
switch to a different panel on the view surface
basic_device & rect(const float &x1, const float &x2, const float &y1, const float &y2)
plot rectangle (cf. poly)
basic_device & sah(const int &fs, const float &angle, const float &barb)
set arrow head style
basic_device & slw(const int &lw)
set line width
Trange x
coordinate ranges
basic_device & scr(const int &ci, const Tcol &rgb)
set color representation by rgb values
basic_device & axis(const char *opt, const Trect &line, const Trange &val, const float &step=0., const int &nsub=0, const float &dmajl=0.01, const float &dmajr=0.01, const float &fmin=0.3, const float &disp=0.05, const float &orient=0.)
plot arbitrary axis
basic_device & lab(const char *xlbl, const char *ylbl, const char *toplbl)
write labels
basic_device & updt(void)
update plot (in buffering mode)
basic_device & draw(const Tcoor &c)
draw line to position
basic_device & sls(const int &ls)
set line style
basic_device & svp(const float &xleft, const float &xright, const float &ybot, const float &ytop)
set viewport (view area)
static void ldev(void)
tell about available devices
basic_device & poly(int n, const float *xpts, const float *ypts)
draw polygonial line
basic_device & axis(const char *opt, const float &x1, const float &y1, const float &x2, const float &y2, const float &v1, const float &v2, const float &step, const int &nsub, const float &dmajl, const float &dmajr, const float &fmin, const float &disp, const float &orient)
plot arbitrary axis
basic_device & gwedg(const Trange &range, const char *label="value", const float &disp=0.3, const float &width=3.0, const char *side="RG")
annotate an image plot with a wedge
basic_device & sfs(const int &fs)
set fill style
basic_device & sclp(const int &state)
set clipping mode
basic_device & wedg(const char *side, const float &disp, const float &width, const float &fg, const float &bg, const char *label)
annotate an image plot with a wedge
float y
y-coordinate shift coordinate by a vector c
basic_device & mtxt(const char *side, const float &disp, const float &coord, const float &fjust, const char *text)
plot text outside viewport (for labels)
basic_device(const char *devName)
constructor opens PGPLOT device
basic_device & move(const Tcoor &c)
move plot position
void devopen(const char *devname)
basic_device & swin(const Trect &win)
set window (world coordinate range)
basic_device & ebuf(void)
stop buffering
basic_device & qwin(float &x1, float &x2, float &y1, float &y2)
inquire window boundary coordinates
basic_device & line(const int &n, const float *xpts, const float *ypts)
draw an open polygon
basic_device & vsiz(const Trect &vp)
set viewport (view area - here: in inches)
basic_device & wnad(const float &x1, const float &x2, const float &y1, const float &y2)
set world coordinates and adjust viewport to same aspect ratio
basic_device & lcur(int maxpt, int *npt, float *x, float *y)
basic_device & env(const float &xmin, const float &xmax, const float &ymin, const float &ymax, const int &just=0, const int &axis=0)
define PGPLOT window and axis
basic_device & subp(int nxsub, int nysub)
subdivide view surface into panels
basic_device & gray(const float *a, int idim, int jdim, int i1, int i2, int j1, int j2, float fg, float bg, const float *tr)
plot gray scale image
basic_device & arro(const float &x1, const float &y1, const float &x2, const float &y2)
plot arrow
basic_device & tbox(const char *xopt, float xtick, int nxsub, const char *yopt, float ytick, int nysub)
plot tbox around graph
basic_device & ptxt(const float &x, const float &y, const float &angle, const float &fjust, const char *text)
write text at arbitraty position
static float rnd(const float &x, int *nsub)
find smallest "round" number greater than x
float min
range [min....max]
int curs(float *x, float *y, char *ch_scalar)
basic_device & ncur(int maxpt, int *npt, float *x, float *y, int symbol)
basic_device & scf(const int &font)
set character font
basic_device & shls(const int &ci, const float &ch, const float &cl, const float &cs)
set color in the HLS system
basic_device & qwin(Trect &win)
inquire window boundary coordinates
static Trange rnge(const Trange &xin)
found suitable range
basic_device & pt1(float xpt, float ypt, int symbol)
draw one marker symbol
a struct to hold colour triples i.e. rgb or hls values
basic_device & qtxt(const float &x, const float &y, const float &angle, const float &fjust, const char *text, Tbbox &b)
get bounding box of text
static void rnge(const float &x1, const float &x2, float *xlo, float *xhi)
found suitable range
basic_device & shls(const int &ci, const Tcol &hls)
set color representation by hls values
basic_device & wnad(const Trect &win)
set world coordinates and adjust viewport to same aspect ratio
basic_device & box(const char *xopt, float xtick, int nxsub, const char *yopt, float ytick, int nysub)
plot box around graph
basic_device & rect(const Trect &rec)
plot rectangle (cf. poly)
basic_device & wedg(const char *side, const float &disp, const float &width, const Trange &range, const char *label)
annotate an image plot with a wedge
basic_device & qcr(const int &ci, float *cr, float *cg, float *cb)
inquire color representation
basic_device & sch(const float &size)
set character height
basic_device & err1(const int &dir, const float &x, const float &y, const float &e, const float &t)
plot single error bar
basic_device & ask(const Logical &flag)
ask before clearing page? (Logical version)
basic_device & unsa(void)
restore device settings