Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BinnerAxis.h

Go to the documentation of this file.
00001 /* -*- mode: c++; -*- */
00013 #ifndef _BinnerAxis_H_
00014 #define _BinnerAxis_H_
00015 
00016 #include "axes/Range.h"
00017 
00018 #include <string>
00019 
00033 class MDL_HIPPOPLOT_API BinnerAxis
00034 {
00035 
00036 private:
00037 
00039   const std::string m_name;
00040 
00042   mutable bool m_dragging;
00043 
00046   virtual int getNob ( double width ) const= 0;
00047 
00049   virtual int getNob (const Range & range ) const = 0;
00050 
00051 protected:
00052 
00055   static int s_num_bins;
00056 
00059   static double s_bin_factor;
00060 
00062   int m_num_bins;
00063 
00066   Range m_range;
00067 
00069   double m_offset;
00070 
00073   double m_width;
00074 
00078   std::vector< double > m_bin_edges;
00079   
00081   mutable Range m_range_start;
00082 
00084   mutable double m_width_start;
00085 
00087   BinnerAxis ( const BinnerAxis & binner );
00088 
00090   BinnerAxis ( const char * name );
00091 
00092  public:
00093 
00095   virtual ~BinnerAxis();
00096   
00099   virtual BinnerAxis * clone() = 0;
00100 
00102   const std::string & name () const;
00103 
00110   virtual bool hasEqualWidths () const;
00111 
00113   double axisGetLow() const;
00114 
00116   double axisGetHigh() const;
00117 
00119   const Range & getRange() const;
00120 
00122   int axisNumberOfBins () const;
00123 
00125   virtual double getConstWid ( ) const = 0;
00126 
00130   virtual double getBinWidth ( ) const = 0;
00131 
00133   virtual void axisSetNumberOfBins( int nb ) = 0;
00134 
00137   virtual int axisBinNumber ( double x ) const = 0;
00138 
00143   virtual double getCoordinate ( int i ) const = 0;
00144 
00146   virtual double axisBinWidth ( int i ) const = 0;
00147 
00150   virtual const std::vector< double > & binEdges ();
00151   
00152   // These functions have been restructured so that setRange takes
00153   // only a new range as an argument and setBinWidth takes only a
00154   // new width (const parameter).
00155 
00158   virtual const Range & setBinWidth ( double width ) = 0;
00159 
00166   virtual double calcBinWidth ( int parm, bool dragging ) const = 0;
00167 
00173   virtual double calcOffset ( int parm, bool dragging ) const = 0;
00174 
00176   virtual double getOffset () const = 0;
00177 
00179   virtual const void setOffset ( double offset ) = 0;
00180 
00184   virtual const Range & setRange ( const Range &,
00185                                    bool hold_width = true ) = 0;
00186 
00188   virtual double scaleFactorWid ( ) = 0;
00189 
00191   void setStartRange ( bool dragging ) const;
00192 
00194   void setStartWidth ( bool dragging ) const;
00195 
00196 };
00197 
00198 #endif // _BinnerAxis_H_

Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3