ViewBase.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _ViewBase_H_
15 #define _ViewBase_H_
16 
17 #include "LineStyle.h"
18 #include "Rectangle.h"
19 #include "SymbolType.h"
20 
21 #include "axes/AxesType.h"
22 #include "pattern/Observer.h"
23 
24 namespace hippodraw {
25 
26 class Color;
27 class FontBase;
28 class PlotterBase;
29 class Range;
30 
63 {
64 protected:
65 
70 
71 public:
72 
74  ViewBase();
75 
78  ViewBase ( PlotterBase * plotter );
79 
81  ViewBase ( const ViewBase & );
82 
84  virtual ~ViewBase();
85 
90  virtual void setPlotter ( PlotterBase * plotter );
91 
93  PlotterBase * getPlotter () const;
94 
96  PlotterBase * getPlotter ();
97 
102  virtual void update ( const Observable * ) = 0;
103 
105  virtual void drawSelf();
106 
116  virtual void drawLines ( const std::vector< double > & x,
117  const std::vector< double > & y,
118  Line::Style style,
119  const Color & color,
120  float size ) = 0;
121 
140  virtual void drawColorLines ( const std::vector< double > & x,
141  const std::vector< double > & y,
142  Line::Style style,
143  const std::vector < Color > & color,
144  float size ) = 0;
145 
155  virtual void drawViewLines ( const std::vector< double > & x,
156  const std::vector< double > & y,
157  Line::Style style,
158  bool color,
159  float size ) = 0;
160 
169  virtual void drawViewLines ( const std::vector< double > & x,
170  const std::vector< double > & y,
171  Line::Style style,
172  const Color & color,
173  float size ) = 0;
180  virtual void drawPolyLine ( const std::vector< double > & xpoints,
181  const std::vector< double > & ypoints,
182  Line::Style style,
183  const Color & color,
184  float size ) = 0;
185 
191  virtual void drawPolygon ( const std::vector <double > & xpoints,
192  const std::vector <double > & ypoints,
193  const Color & color,
194  const Color & edge );
195 
196 
229  virtual void drawText ( const std::string &s, float x, float y,
230  float fontsize, float angle = 0.0,
231  char xp = 'l', char yp = 't',
232  bool resize = false,
233  const FontBase * font = 0,
234  const Color * color = 0 ) = 0;
235 
236 
241  virtual void drawImage ( const std::string &filename, int position = 0);
242 
246  virtual void drawLatex ( const std::string &eq, int position = 0);
247 
251  virtual void drawPoints ( const std::vector<double> & x,
252  const std::vector<double> & y,
254  float sym_size,
255  const Color & color ) = 0;
256 
262  virtual void drawPoints ( const std::vector< double > & x,
263  const std::vector< double > & y,
264  const std::vector< Color > & colors,
266  float sym_size ) = 0;
267 
270  virtual void drawSquare ( double x1, double y1, double x2, double y2,
271  int red, int green, int blue ) = 0;
272 
275  virtual void drawViewSquare ( float x1, float y1, float x2, float y2,
276  int red, int green, int blue ) = 0;
277 
280  const Range & getRange ( Axes::Type axis ) const;
281 
285  const Rect & getUserRect () const;
286 
289  const Rect & getRawRect () const;
290 
293  virtual Rect getDrawRect() const = 0;
294 
296  virtual void updateDrawRect();
297 
299  virtual void setDrawRect ( float x, float y, float w, float h ) = 0;
300 
303  virtual float userToDrawX ( double x ) const = 0;
304  virtual float userToDrawXAutoInv ( double x ) const = 0;
305 
308  virtual float userToDrawY ( double y ) const = 0;
309 
312  virtual float userToDrawColor ( double c ) const = 0;
313 
315  virtual double getAspectRatio () const;
316 
319  virtual void willDelete ( const Observable * plotter );
320 
321 };
322 
323 } // namespace hippodraw
324 
325 #endif // _ViewBase_H_

Generated for HippoDraw Class Library by doxygen