ViewBase.cxx
Go to the documentation of this file.
1 
12 // inconsistent dll linkage
13 #ifdef _MSC_VER
14 #include "msdevstudio/MSconfig.h"
15 #endif
16 
17 #include "ViewBase.h"
18 
19 #include "plotters/PlotterBase.h"
20 
21 #include <cassert>
22 
23 using std::list;
24 
25 using namespace hippodraw;
26 
28  : m_plotter ( 0 )
29 {
30 }
31 
33  : m_plotter ( plotter )
34 {
35 }
36 
38 {
39  // Do not delete plotter here, some derived classes, such as
40  // EPSView, are only temporary and don't own the plotter.
41 }
42 
43 void
45 setPlotter ( PlotterBase * plotter )
46 {
47  m_plotter = plotter;
48 }
49 
51 {
52  return m_plotter;
53 }
54 
56 {
57  return m_plotter;
58 }
59 
61 {
62  assert ( m_plotter );
63  m_plotter -> prepareToDraw ();
64  m_plotter->drawIn ( this );
65 }
66 
67 const Range &
70 {
71  return m_plotter -> getRange ( axis, false );
72 }
73 
74 const Rect &
76 getUserRect() const
77 {
78  return m_plotter->getUserRect();
79 }
80 
81 const Rect &
83 getRawRect() const
84 {
85  return m_plotter->getRawRect();
86 }
87 
88 double ViewBase::getAspectRatio () const
89 {
90  assert ( m_plotter );
91  return m_plotter -> getAspectRatio ();
92 }
93 
94 void
96 willDelete ( const Observable * observee )
97 {
98  if ( observee == m_plotter ) {
99  m_plotter = 0;
100  }
101 }
102 
103 void
106 {
107  // Do nothing in base class.
108 }
109 
110 void
112 drawImage ( const std::string &filename, int position )
113 {
114  // Do nothing in base class.
115 }
116 
117 void
119 drawLatex ( const std::string &eq, int position )
120 {
121  // Do nothing in base class.
122 }
123 
124 void
126 drawPolygon ( const std::vector <double > & xpoints,
127  const std::vector <double > & ypoints,
128  const Color & color,
129  const Color & edge )
130 {
131  // Do nothing in base class.
132 }

Generated for HippoDraw Class Library by doxygen