PlotLoop.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2006 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Plotting/Pulsar/PlotLoop.h
10 
11 #ifndef __Pulsar_PlotLoop_h
12 #define __Pulsar_PlotLoop_h
13 
14 #include "TextIndex.h"
15 #include <stack>
16 
17 namespace Pulsar {
18 
19  class Archive;
20  class Plot;
21 
23  class PlotLoop : public Reference::Able {
24 
25  public:
26 
29 
31  void add_Plot (Plot*);
32 
34  void configure (const std::vector<std::string>& options);
35 
37  void finalize ();
38 
40  void set_Archive (Archive*);
41 
43  void set_overlay (bool);
44  bool get_overlay () const;
45 
47  void set_stack (bool);
48  bool get_stack () const;
49 
51  void set_colour_indeces (const std::vector<unsigned>& ci);
52 
54  void set_preprocess (bool);
55 
57  bool get_preprocess () const;
58 
60  void add_index (TextIndex*);
61 
62  // execute the plot for each index in the stack
63  void plot ();
64 
65  // set the colour for the plot
66  void set_colour_index (Plot*, unsigned colour_index);
67 
68  protected:
69 
70  std::vector< Reference::To<Plot> > plots;
71 
72  std::vector< Reference::To<Archive> > archives;
73 
74  bool preprocess;
75  bool overlay;
76  bool stack;
77 
78  std::stack< Reference::To<TextIndex> > index_stack;
79 
80  std::vector<unsigned> colour_indeces;
81  unsigned current_colour_index;
82 
84  void plot ( std::stack< Reference::To<TextIndex> >& indeces );
85 
86  };
87 
88 }
89 
90 #endif
bool get_preprocess() const
Get the preprocess flag.
Definition: PlotLoop.C:129
void set_preprocess(bool)
Set the preprocess flag.
Definition: PlotLoop.C:124
Plots multiple viewports.
Definition: MultiPlot.h:27
The primary interface to pulsar observational data.
Definition: Archive.h:45
Value * find(const std::string &name, bool throw_exception=true) const
Stores three labels: left, centre, and right.
Definition: PlotLabel.h:27
virtual void set_value(const std::string &value)=0
void set_stack(bool)
Automatically stack multiple plots.
Definition: PlotLoop.C:115
void configure(const std::vector< std::string > &options)
Configure the plots.
Definition: PlotLoop.C:43
void finalize()
Perform any cleanup.
Definition: PlotLoop.C:69
void set_overlay(bool)
Overlay the data from multiple objects in a single plot.
Definition: PlotLoop.C:105
virtual Archive * result()
If process if out of place, return pointer to new result.
Definition: Processor.h:38
void set_colour_indeces(const std::vector< unsigned > &ci)
Set the colour indeces through which to loop.
Definition: PlotLoop.C:134
virtual void process(Archive *)=0
Process the archive (either in place or out of place)
void add_Plot(Plot *)
Add a Plot to be executed.
Definition: PlotLoop.C:37
Interface to any object that processes data in an Archive.
Definition: Processor.h:27
void add_index(TextIndex *)
Add an index over which to loop.
Definition: PlotLoop.C:140
PlotLoop()
Default constructor.
Definition: PlotLoop.C:27
virtual Archive * clone() const =0
Return a new copy constructed instance equal to this.
const std::string get_message() const
std::string get_centre() const
Get the label to be drawn in the centre of the frame.
Definition: PlotLabel.h:54
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void set_centre(const std::string &label)
Set the label to be drawn in the centre of the frame.
Definition: PlotLabel.h:52
void set_Archive(Archive *)
Set the Archive to be plotted.
Definition: PlotLoop.C:79
Base class of all plotters.
Definition: Plot.h:28

Generated using doxygen 1.8.17