AxisRepBase.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _AxisRepBase_H_
15 #define _AxisRepBase_H_
16 
17 #include "axes/AxesType.h"
18 #include "graphics/FontBase.h"
19 
20 #include <vector>
21 
22 namespace hippodraw {
23 
24 class AxisModelBase;
25 class AxisTick;
26 class BinToColor;
27 class TransformBase;
28 class ViewBase;
29 class Range;
30 
50 {
51 
52 protected:
53 
56 
61 
66 
68  float m_axis_width;
69 
72 
75  double m_font_size;
76 
80 
84 
87  double m_x_font_size;
88 
91  double m_y_font_size;
92 
95  double m_z_font_size;
96 
99 
102 
105 
108 
112 
120  void initAxisRect ( ViewBase & view );
121 
123  void drawXTickLines ( const AxisModelBase & axisModelX,
124  const AxisModelBase & axisModelY,
125  const TransformBase & transform,
126  ViewBase & view );
127 
129  void drawYTickLines ( const AxisModelBase & axisModelX,
130  const AxisModelBase & axisModelY,
131  const TransformBase & transform,
132  ViewBase & view );
133 
134  public:
135 
138  AxisRepBase();
139 
141  AxisRepBase( const AxisRepBase & axis_rep );
142 
144  virtual ~AxisRepBase();
145 
148  virtual AxisRepBase * clone() = 0;
149 
154  void beginPlot ( ViewBase & view );
155 
156 
159  void setXFontSize ( const AxisModelBase & axis_model,
160  ViewBase & view );
161 
163  void setXLabelFont( FontBase* font );
164 
167  FontBase* xLabelFont();
168 
171  void setYFontSize ( const AxisModelBase & axis_model, ViewBase & view );
172 
174  void setYLabelFont( FontBase* font );
175 
178  FontBase* yLabelFont();
179 
182  void setZFontSize ( const AxisModelBase & axis_model, ViewBase & view );
183 
185  void setZLabelFont( FontBase* font );
186 
189  FontBase* zLabelFont();
190 
192  void setTitleFont( FontBase* font );
193 
196  FontBase* titleFont();
197 
199  void setDrawTitles( bool set );
200 
202  void drawXLabels( const AxisModelBase & axis_model,
203  ViewBase & view, const std::string & x_label );
205  void drawYLabels( const AxisModelBase & axis_model,
206  ViewBase & view, const std::string & y_label );
207 
211  virtual void setFontSize( const AxisModelBase * x_axis,
212  const AxisModelBase * y_axis,
213  const AxisModelBase * z_axis,
214  ViewBase & view );
215 
218  virtual void drawAxesLines ( TransformBase & transform,
219  ViewBase & view,
220  const Range & x_range,
221  const Range & y_range);
222 
224  virtual void drawCrossHairs ( double x, double y,
225  TransformBase & transform,
226  ViewBase & view );
227 
230  virtual void drawTitle( ViewBase & view, const std::string & title );
231 
232  virtual void drawZLabels ( const AxisModelBase & axis_model,
233  ViewBase & view,
234  const std::string & z_label ) = 0;
235 
239  virtual void drawAllXTicks ( const AxisModelBase & axisModelX,
240  const AxisModelBase & axisModelY,
241  const TransformBase & transform,
242  ViewBase & view );
243 
247  virtual void drawAllYTicks ( const AxisModelBase & axisModelX,
248  const AxisModelBase & axisModelY,
249  const TransformBase & transform,
250  ViewBase & view );
251 
252 
257  virtual void drawAllZTicks ( const AxisModelBase & axis_model,
258  const TransformBase & transform,
259  ViewBase & view ) = 0;
260 
266  void drawReferencePoint( const AxisModelBase & axisModel,
267  ViewBase & base,
268  const std::string & ref);
269 
270 
272  void drawXMag ( const AxisModelBase & axisModel,
273  ViewBase & view, const std::string & mag="");
274 
276  void drawYMag ( const AxisModelBase & axisModel,
277  ViewBase & view, const std::string & mag="");
278 
281  virtual void drawGridLines( const AxisModelBase & axisModelX,
282  const AxisModelBase & axisModelY,
283  TransformBase & transform,
284  ViewBase & view );
285 
289  virtual void drawColorScale ( const BinToColor &, ViewBase & );
290 
291 protected:
292 
294  void drawXTickLabels ( const AxisModelBase & axisModelX,
295  const AxisModelBase & axisModelY,
296  const TransformBase & transform,
297  ViewBase & view );
298 
300  void drawYTickLabels ( const AxisModelBase & axisModelX,
301  const AxisModelBase & axisModelY,
302  const TransformBase & transform,
303  ViewBase & view );
304 
307  void drawXTickLabel ( const std::string & label,
308  float x, float y,
309  ViewBase & view );
310 
314  void drawYTickLabels ( const std::vector < AxisTick > & ticks,
315  const std::vector < float > & xv,
316  const std::vector < float > & yv,
317  ViewBase & view );
318 
321  void drawYTickLabel ( const std::string & label,
322  float x, float y,
323  ViewBase & view );
324 
325 };
326 
327 } // namespace hippodraw
328 
329 #endif // _AxisRepBase_H_

Generated for HippoDraw Class Library by doxygen