Plot.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2006-2010 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Plotting/Pulsar/Plot.h
10 
11 #ifndef __Pulsar_Plot_h
12 #define __Pulsar_Plot_h
13 
14 #include "Pulsar/PlotAttributes.h"
15 #include "TextInterface.h"
16 
17 namespace Pulsar {
18 
19  class Archive;
20  class Processor;
21 
23  class Plot : public Reference::Able {
24 
25  public:
26 
28  static bool verbose;
29 
31  Plot ();
32 
34  virtual void preprocess (Archive*);
35 
37  virtual void plot (const Archive*) = 0;
38 
40  virtual void finalize () { }
41 
43  virtual PlotAttributes* get_attributes () = 0;
44 
46  virtual TextInterface::Parser* get_interface () = 0;
47 
50 
52  virtual void configure (const std::string&);
53 
55  class Constructor;
56 
58  void set_constructor (Constructor* c) { constructor = c; }
59 
61  Constructor* get_constructor ();
62 
64  virtual void set_preprocessor (Processor*);
65 
67  virtual Processor* get_preprocessor ();
68 
70  virtual bool has_preprocessor () const;
71 
72  private:
73 
74  // used by the configure method
77 
78  Reference::To<Processor> preprocessor;
79 
81  Constructor* constructor;
82  };
83 
89  class Plot::Constructor
90  {
91  public:
92 
93  virtual ~Constructor () { }
94 
96  virtual Plot* construct () = 0;
97  };
98 
99 }
100 
101 #endif
virtual void plot(const Archive *)=0
Plot in the current viewport.
virtual TextInterface::Parser * get_interface()=0
Get the text interface to the configuration attributes.
virtual PlotAttributes * get_attributes()=0
Provide access to the plot attributes.
virtual void configure(const std::string &)
Process a configuration command.
Definition: Plot.C:29
The primary interface to pulsar observational data.
Definition: Archive.h:45
virtual void preprocess(Archive *)
Process the Archive as needed before calling plot.
Definition: Plot.C:47
Stores the properties of the plot frame.
Definition: PlotAttributes.h:25
virtual Plot * construct()=0
Return a new default constructed instance of a derived type.
Constructor * get_constructor()
Get the constructor.
Definition: Plot.C:20
static bool verbose
Verbosity flag.
Definition: Plot.h:33
Definition: Plot.h:94
virtual void set_preprocessor(Processor *)
Set the pre-processor.
Definition: Plot.C:53
Interface to any object that processes data in an Archive.
Definition: Processor.h:27
virtual bool has_preprocessor() const
Return true if pre-processor has been set.
Definition: Plot.C:65
void set_constructor(Constructor *c)
Set the constructor.
Definition: Plot.h:63
Defines the PSRCHIVE library.
Definition: CalSource.h:17
virtual Processor * get_preprocessor()
Get the pre-processor.
Definition: Plot.C:59
virtual TextInterface::Parser * get_frame_interface()=0
Get the text interface to the frame attributes.
Plot()
Default constructor.
Definition: Plot.C:14
Base class of all plotters.
Definition: Plot.h:28
virtual void finalize()
Some plots may postpone plotting.
Definition: Plot.h:45

Generated using doxygen 1.8.17