libpgplotxx.a (C++ interface to PGPLOT)

◆ apply()

void pgplot::Tboxstyle::apply ( basic_device dev) const
private

apply to basic device class

Definition at line 306 of file xpgplotxx.cc.

References pgplot::boxflags::Fbselect, pgplot::boxflags::Fhselect, pgplot::boxflags::Flabeldec, pgplot::boxflags::Flabelexp, pgplot::boxflags::Flabellog, pgplot::boxflags::Flabelopp, pgplot::boxflags::Flabelvert, pgplot::boxflags::Flselect, pgplot::boxflags::Frselect, pgplot::boxflags::Fticksextend, pgplot::boxflags::Fticksinvert, pgplot::boxflags::Fticksmajor, pgplot::boxflags::Fticksminor, pgplot::boxflags::Ftimedegrees, pgplot::boxflags::Ftimemod24, pgplot::boxflags::Ftimenoday, pgplot::boxflags::Ftimeomitfirst, pgplot::boxflags::Ftimeomitzeros, pgplot::boxflags::Ftimesuper, pgplot::boxflags::Ftselect, pgplot::boxflags::Fvselect, pgplot::boxflags::Fxselect, pgplot::boxflags::Fxyselect, pgplot::boxflags::Fyselect, issuecommand(), Maxisflags, Maxisstyle, Mframeflags, Mframestyle, Mgridflags, Mgridstyle, Mlabelstyle, Mtbox, Mticksstyle, Mxlabelflags, Mxtickflags, Mxtimeflags, Mylabelflags, Mytickflags, Mytimeflags, pgplot::basic_device::save(), and pgplot::basic_device::unsa().

Referenced by operator()().

307  {
308  // save plot settings
309  dev.save();
310 
311  std::string xopt, yopt;
312 
313  // prepare time options as base for all further calls
314  std::string txopt="", tyopt="";
315  if (Mtbox)
316  {
318  {
319  if (Mxtimeflags& Fxyselect)
320  {
321  txopt.append("Z");
322  if (Mxtimeflags& Ftimenoday ) txopt.append("Y");
323  if (Mxtimeflags& Ftimemod24 ) txopt.append("X");
324  if (Mxtimeflags& Ftimesuper ) txopt.append("H");
325  if (Mxtimeflags& Ftimedegrees ) txopt.append("D");
326  if (Mxtimeflags& Ftimeomitfirst ) txopt.append("F");
327  if (Mxtimeflags& Ftimeomitzeros ) txopt.append("O");
328  } // if (Mxtimeflags& Fxyselect)
329  if (Mytimeflags& Fxyselect)
330  {
331  tyopt.append("Z");
332  if (Mytimeflags& Ftimenoday ) tyopt.append("Y");
333  if (Mytimeflags& Ftimemod24 ) tyopt.append("X");
334  if (Mytimeflags& Ftimesuper ) tyopt.append("H");
335  if (Mytimeflags& Ftimedegrees ) tyopt.append("D");
336  if (Mytimeflags& Ftimeomitfirst ) tyopt.append("F");
337  if (Mytimeflags& Ftimeomitzeros ) tyopt.append("O");
338  } // if (Mytimeflags& Fxyselect)
339  } // if ((Mxtimeflags&Fxyselect)|(Mytimeflags&Fxyselect))
340  } // if (Mtbox)
341 
342  // frame
343  if (Mframeflags)
344  {
345  xopt=txopt; yopt=tyopt;
346  if (Mframeflags& Flselect ) yopt.append("B");
347  if (Mframeflags& Frselect ) yopt.append("C");
348  if (Mframeflags& Fbselect ) xopt.append("B");
349  if (Mframeflags& Ftselect ) xopt.append("C");
350 
351  this->issuecommand(dev, Mframestyle, xopt.c_str(), yopt.c_str());
352 
353  // ticks
354  // PGPLOT will draw ticks only when frame is drawn
355  // accumulate xopt and yopt
357  {
358  if (Mxtickflags& Fxyselect)
359  {
360  if (Mxtickflags& Fticksinvert ) xopt.append("I");
361  if (Mxtickflags& Fticksextend ) xopt.append("P");
362  if (Mxtickflags& Fticksmajor ) xopt.append("T");
363  if (Mxtickflags& Fticksminor ) xopt.append("S");
364  }
365  if (Mytickflags& Fxyselect )
366  {
367  if (Mytickflags& Fticksinvert ) yopt.append("I");
368  if (Mytickflags& Fticksextend ) yopt.append("P");
369  if (Mytickflags& Fticksmajor ) yopt.append("T");
370  if (Mytickflags& Fticksminor ) yopt.append("S");
371  }
372 
373  // redraws frame in ticksstyle but now also plots tick marks
374  this->issuecommand(dev, Mticksstyle, xopt.c_str(), yopt.c_str());
375  }
376  }
377 
378  // axis
379  if (Maxisflags)
380  {
381  xopt=txopt; yopt=tyopt;
382  if (Maxisflags& Fxselect ) xopt.append("A");
383  if (Maxisflags& Fyselect ) yopt.append("A");
384  this->issuecommand(dev, Maxisstyle, xopt.c_str(), yopt.c_str());
385  }
386 
387  // grid
388  if (Mgridflags)
389  {
390  xopt=txopt; yopt=tyopt;
391  if (Mgridflags& Fvselect ) xopt.append("G");
392  if (Mgridflags& Fhselect ) yopt.append("G");
393  this->issuecommand(dev, Mgridstyle, xopt.c_str(), yopt.c_str());
394  }
395 
396  // labels
398  {
399  xopt=txopt; yopt=tyopt;
400  if (Mxlabelflags& Fxyselect)
401  {
402  if (Mxlabelflags& Flabelopp ) {
403  xopt.append("M");
404  } else {
405  xopt.append("N");
406  }
407  if (Mxlabelflags& Flabelvert ) xopt.append("V");
408  if (Mxlabelflags& Flabeldec ) {
409  xopt.append("1");
410  } else if (Mxlabelflags& Flabelexp ) {
411  xopt.append("2");
412  }
413  if (Mxlabelflags& Flabellog ) xopt.append("L");
414  }
415  if (Mylabelflags& Fxyselect)
416  {
417  if (Mylabelflags& Flabelopp ) {
418  yopt.append("M");
419  } else {
420  yopt.append("N");
421  }
422  if (Mylabelflags& Flabelvert ) yopt.append("V");
423  if (Mylabelflags& Flabeldec ) {
424  yopt.append("1");
425  } else if (Mylabelflags& Flabelexp ) {
426  yopt.append("2");
427  }
428  if (Mylabelflags& Flabellog ) yopt.append("L");
429  }
430  this->issuecommand(dev, Mlabelstyle, xopt.c_str(), yopt.c_str());
431  }
432 
433  // restore plot settings
434  dev.unsa();
435  } // Tboxstyle::apply
yselect, vselect, rselect (y, vertical, right)
Definition: xpgplotxx.h:343
bool Mtbox
is a TBOX
Definition: xpgplotxx.h:540
int Mytimeflags
is a TBOX
Definition: xpgplotxx.h:542
Tlinestyle Maxisstyle
axis linestyle
Definition: xpgplotxx.h:514
Tlinestyle Mframestyle
frame linestyle
Definition: xpgplotxx.h:506
int Mxtickflags
tick options
Definition: xpgplotxx.h:520
opposite (labels)
Definition: xpgplotxx.h:369
int Mgridflags
has grid
Definition: xpgplotxx.h:496
setting selection flags
Definition: xpgplotxx.h:343
int Mxlabelflags
label options
Definition: xpgplotxx.h:532
major (tick marks)
Definition: xpgplotxx.h:361
logarithmic scale (labels)
Definition: xpgplotxx.h:377
Tlinestyle Mgridstyle
grid linestyle
Definition: xpgplotxx.h:498
Tlinestyle Mticksstyle
ticks linestyle
Definition: xpgplotxx.h:526
setting selection flags
Definition: xpgplotxx.h:341
extend (tick marks)
Definition: xpgplotxx.h:359
force exponential (labels)
Definition: xpgplotxx.h:375
int Mylabelflags
label options
Definition: xpgplotxx.h:532
omit first label (time scale)
Definition: xpgplotxx.h:391
degrees, minutes, and seconds (time scale)
Definition: xpgplotxx.h:389
bselect (bottom)
Definition: xpgplotxx.h:347
setting selection flags
Definition: xpgplotxx.h:343
void issuecommand(basic_device &dev, const Tlinestyle &linestyle, const char *xopt, const char *yopt) const
issue appropriate box command
Definition: xpgplotxx.cc:286
do not include day field (time scale)
Definition: xpgplotxx.h:383
int Mytickflags
tick options
Definition: xpgplotxx.h:520
int Mxtimeflags
time scale options
Definition: xpgplotxx.h:542
force decimal (labels)
Definition: xpgplotxx.h:373
setting selection flags
Definition: xpgplotxx.h:341
hour modulus 24h (time scale)
Definition: xpgplotxx.h:385
Fxyselect, Fhvselect (x and y, left and right)
Definition: xpgplotxx.h:351
int Mframeflags
has frame
Definition: xpgplotxx.h:504
vertical (labels)
Definition: xpgplotxx.h:371
minor (tick marks)
Definition: xpgplotxx.h:363
omit leading zeros (time scale)
Definition: xpgplotxx.h:393
use superscript symbols (time scale)
Definition: xpgplotxx.h:387
setting selection flags
Definition: xpgplotxx.h:341
Tlinestyle Mlabelstyle
labels linestyle
Definition: xpgplotxx.h:534
int Maxisflags
has axis
Definition: xpgplotxx.h:512
Here is the call graph for this function:
Here is the caller graph for this function: