MultiFrame.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/MultiFrame.h
10 
11 #ifndef __Pulsar_MultiFrame_h
12 #define __Pulsar_MultiFrame_h
13 
14 #include "Pulsar/PlotFrame.h"
15 #include <map>
16 
17 namespace Pulsar {
18 
20  class MultiFrame : public PlotAttributes {
21 
22  public:
23 
24  // Text interface to the MultiFrame class
25  class Interface : public TextInterface::To<MultiFrame> {
26  public:
27  Interface (MultiFrame* = 0);
28  };
29 
31  void manage (const std::string& name, PlotFrame*);
32 
34  PlotFrame* get_frame (const std::string& name);
35 
37  PlotEdge* get_x_edge() { return &x_edge; }
38 
40  PlotEdge* get_y_edge() { return &y_edge; }
41 
43  PlotScale* get_shared_x_scale() { return x_scale; }
44  bool has_shared_x_scale () { return x_scale; }
45  void set_shared_x_scale (PlotScale* x) { x_scale = x; }
46 
48  PlotScale* get_shared_y_scale() { return y_scale; }
49  bool has_shared_y_scale () { return y_scale; }
50  void set_shared_y_scale (PlotScale* y) { y_scale = y; }
51 
53  void set_character_height (float height);
54 
56  void set_character_font (int font);
57 
59  void set_line_width (int width);
60 
62  void no_labels ();
63 
65  virtual void init (const Archive*);
66 
68  virtual void focus (const Archive*);
69 
71  virtual void decorate (const Archive*);
72 
74  virtual void include (MultiFrame* other);
75 
77  virtual void copy (MultiFrame* other);
78 
80  virtual void freeze (bool f = true);
81 
82  protected:
83 
84  std::map< std::string, Reference::To<PlotFrame> > frames;
85 
86  PlotEdge x_edge;
87  PlotEdge y_edge;
88 
91 
92  };
93 
94 }
95 
96 #endif
The edge of a plot viewport.
Definition: PlotEdge.h:26
virtual void set_character_height(float h)
Set the character height.
Definition: PlotAttributes.C:27
virtual void init(const Archive *)
Initialize each frame.
Definition: MultiFrame.C:89
PlotFrame * get_frame(const std::string &name)
Return a previously mapped plot frame.
Definition: MultiFrame.C:45
virtual void focus(const Archive *)
Focus the frame.
Definition: MultiFrame.C:24
virtual void decorate(const Archive *)
Decorate the frame.
Definition: MultiFrame.C:37
The primary interface to pulsar observational data.
Definition: Archive.h:45
The scale on an axis.
Definition: PlotScale.h:26
void no_labels()
Set no_labels in all sub-plots.
Definition: MultiFrame.C:109
PlotScale * get_shared_x_scale()
Return the shared x-scale.
Definition: MultiFrame.h:53
virtual void include(MultiFrame *other)
Expand the x and y scales of all sub-plots to include other.
Definition: MultiFrame.C:124
void set_character_font(int font)
Set the character font.
Definition: MultiFrame.C:74
virtual void copy(MultiFrame *other)
Copy the x and y scales.
Definition: MultiFrame.C:131
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void set_line_width(int width)
Set the line width.
Definition: MultiFrame.C:82
Manages multiple plot frames.
Definition: MultiFrame.h:25
PlotEdge * get_x_edge()
Return the x-edge.
Definition: MultiFrame.h:47
PlotEdge * get_y_edge()
Return the y-edge.
Definition: MultiFrame.h:50
virtual void freeze(bool f=true)
Freeze all frames.
Definition: MultiFrame.C:95
void manage(const std::string &name, PlotFrame *)
Manage the given PlotFrame.
Definition: MultiFrame.C:15
virtual void set_character_font(int font)
Set the character font.
Definition: PlotAttributes.C:33
Stores the properties of the plot frame.
Definition: PlotFrame.h:31
PlotScale * get_shared_y_scale()
Return the shared y-scale.
Definition: MultiFrame.h:58
void set_character_height(float height)
Set the character height.
Definition: MultiFrame.C:66
virtual void set_line_width(int width)
Set the line width.
Definition: PlotAttributes.C:39

Generated using doxygen 1.8.17