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 
00020 namespace hippodraw {
00021 
00035 class MDL_HIPPOPLOT_API BinnerAxis
00036 {
00037 
00038 private:
00039 
00041   const std::string m_name;
00042 
00044   mutable bool m_dragging;
00045 
00048   virtual int getNob ( double width ) const= 0;
00049 
00051   virtual int getNob (const Range & range ) const = 0;
00052 
00053 protected:
00054 
00057   static int s_num_bins;
00058 
00061   static double s_bin_factor;
00062 
00064   mutable int m_num_bins;
00065 
00068   Range m_range;
00069 
00071   double m_offset;
00072 
00075   double m_width;
00076 
00080   std::vector< double > m_bin_edges;
00081   
00083   mutable Range m_range_start;
00084 
00086   mutable double m_width_start;
00087 
00089   BinnerAxis ( const BinnerAxis & binner );
00090 
00092   BinnerAxis ( const char * name );
00093 
00096   virtual double calcWidthParm ( int number ) const = 0;
00097 
00098  public:
00099 
00101   virtual ~BinnerAxis();
00102   
00105   virtual BinnerAxis * clone() = 0;
00106 
00108   const std::string & name () const;
00109 
00116   virtual bool hasEqualWidths () const;
00117 
00119   double axisGetLow() const;
00120 
00122   double axisGetHigh() const;
00123 
00125   const Range & getRange() const;
00126 
00128   int axisNumberOfBins () const;
00129 
00131   virtual double getConstWid ( ) const = 0;
00132 
00136   virtual double getBinWidth ( ) const = 0;
00137 
00139   virtual void axisSetNumberOfBins( int nb ) = 0;
00140 
00143   virtual int axisBinNumber ( double x ) const = 0;
00144 
00149   virtual double getCoordinate ( int i ) const = 0;
00150 
00152   virtual double axisBinWidth ( int i ) const = 0;
00153 
00156   virtual const std::vector< double > & binEdges ();
00157   
00160   virtual const Range & setBinWidth ( double width ) = 0;
00161 
00167   virtual double calcOffset ( int parm, bool dragging ) const = 0;
00168 
00170   virtual double getOffset () const = 0;
00171 
00173   virtual const void setOffset ( double offset ) = 0;
00174 
00178   virtual const Range & setRange ( const Range &,
00179                                    bool hold_width = true ) = 0;
00180 
00182   virtual double scaleFactorWid ( ) = 0;
00183 
00185   void setStartRange ( bool dragging ) const;
00186 
00188   void setStartWidth ( bool dragging ) const;
00189 
00197   double calcBinWidth ( int parm, bool dragging ) const;
00198 
00199 };
00200 
00201 } // namespace hippodraw
00202 
00203 #endif // _BinnerAxis_H_

Generated for HippoDraw Class Library by doxygen