PlotOptions.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2008 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Plotting/Pulsar/PlotOptions.h
10 
11 #ifndef __Pulsar_PlotOptions_h
12 #define __Pulsar_PlotOptions_h
13 
14 #include "Pulsar/Application.h"
15 
16 namespace Pulsar {
17 
18  class Interpreter;
19 
21  class PlotOptions : public Application::Options
22  {
23  public:
24 
26  PlotOptions (bool open_device = true);
27 
29  void set_open_device (bool flag);
30 
32  void set_device (const std::string& dev) { plot_device = dev; }
33 
35  void set_pixels (const std::string&);
36 
38  void set_panels (const std::string&);
39 
41  unsigned get_x_npanel () const { return x_npanel; }
42  void set_x_npanel (unsigned n) { x_npanel = n; }
43 
44  unsigned get_y_npanel () const { return y_npanel; }
45  void set_y_npanel (unsigned n) { y_npanel = n; }
46 
48  void setup ();
49 
51  void finalize ();
52 
53  private:
54 
56  virtual void add_options (CommandLine::Menu&);
57 
58  std::string plot_device;
59 
60  // number of panel into which plot surface will be divided
61  unsigned x_npanel, y_npanel;
62 
63  // width of plot surface in cm
64  float surface_width;
65 
66  // aspect ratio (height/width)
67  float aspect_ratio;
68 
69  // plot dimensions in pixels
70  unsigned width_pixels, height_pixels;
71 
72  // open device
73  bool open_device;
74  };
75 
76 }
77 
78 #endif
void set_open_device(bool flag)
Enable/disable pgplot device open and close.
Definition: PlotOptions.C:37
void set_pixels(const std::string &)
Set the plot dimensions in pixels.
Definition: PlotOptions.C:66
PlotOptions(bool open_device=true)
Default constructor.
Definition: PlotOptions.C:18
unsigned get_x_npanel() const
Get the number of panels into which the plot surface is divided.
Definition: PlotOptions.h:46
void set_device(const std::string &dev)
Set the plot device.
Definition: PlotOptions.h:37
void set_panels(const std::string &)
Set the number of panels into which the plot surface is divided.
Definition: PlotOptions.C:75
void setup()
Open the plot device and configure it.
Definition: PlotOptions.C:84
virtual void add(Item *)
void finalize()
Close the plot device.
Definition: PlotOptions.C:116
Defines the PSRCHIVE library.
Definition: CalSource.h:17

Generated using doxygen 1.8.17