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
17namespace Pulsar {
18
19 class Archive;
20 class Plot;
21
23 class PlotLoop : public Reference::Able {
24
25 public:
26
28 PlotLoop ();
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
The primary interface to pulsar observational data.
Definition Archive.h:46
void set_overlay(bool)
Overlay the data from multiple objects in a single plot.
Definition PlotLoop.C:105
void add_Plot(Plot *)
Add a Plot to be executed.
Definition PlotLoop.C:37
bool get_preprocess() const
Get the preprocess flag.
Definition PlotLoop.C:129
void add_index(TextIndex *)
Add an index over which to loop.
Definition PlotLoop.C:140
void set_Archive(Archive *)
Set the Archive to be plotted.
Definition PlotLoop.C:79
void set_colour_indeces(const std::vector< unsigned > &ci)
Set the colour indeces through which to loop.
Definition PlotLoop.C:134
PlotLoop()
Default constructor.
Definition PlotLoop.C:27
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_preprocess(bool)
Set the preprocess flag.
Definition PlotLoop.C:124
void set_stack(bool)
Automatically stack multiple plots.
Definition PlotLoop.C:115
Base class of all plotters.
Definition Plot.h:23
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0