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

BinsBase.h

Go to the documentation of this file.
00001 /* -*- mode: c++ -*- */
00002 
00014 #ifndef _BinsBase_H_
00015 #define _BinsBase_H_
00016 
00017 #include "axes/AxesType.h"
00018 #include "pattern/libhippo.h"
00019 
00020 #include <list>
00021 #include <vector>
00022 
00023 class BinnerAxis;
00024 class DataSource;
00025 class NTuple;
00026 class Range;
00027 
00032 class MDL_HIPPOPLOT_API BinsBase
00033 {
00034 
00035 private: 
00036 
00038   const std::string m_name;
00039 
00040 protected:
00041 
00045   double m_scale_factor;
00046 
00049   bool m_is_scaling;
00050 
00052   mutable bool m_values_dirty;
00053 
00057   bool m_empty;
00058 
00060   BinsBase ( const char * name );
00061 
00063   BinsBase ( const BinsBase & binner );
00064 
00066   virtual double getLow ( hippodraw::Axes::Type axis ) const = 0;
00067 
00069   virtual void setNumberOfBins ( hippodraw::Axes::Type axis, int number ) = 0;
00070 
00071  public:
00072 
00074   virtual ~BinsBase();
00075 
00077   virtual BinsBase * clone () const = 0;
00078 
00080   const std::string & name () const;
00081 
00083   virtual int getNumberOfAxes () const = 0;
00084 
00088   virtual int getNumberOfEntries () const = 0;
00089 
00095   virtual void scaleNumberOfEntries ( double number );
00096 
00100   virtual void setEntriesScaling ( bool on );
00101 
00105   bool isEmpty () const;
00106 
00108   virtual const BinnerAxis * 
00109   getBinnerOn ( hippodraw::Axes::Type axis ) const = 0;
00110 
00112   virtual void setBinnerOn ( BinnerAxis *, hippodraw::Axes::Type axis ) = 0;
00113 
00115   virtual void reset() = 0;
00116 
00118   bool isDirty();
00119 
00121   void setDirty();
00122 
00127   virtual double scaleFactor () const;
00128 
00131   virtual bool hasEqualWidths () const = 0;
00132 
00135   virtual int numberOfBins ( hippodraw::Axes::Type axis ) const = 0;
00136 
00142   virtual double binWidth ( hippodraw::Axes::Type axis ) const = 0;
00143 
00145   virtual const Range & 
00146   setBinWidth ( hippodraw::Axes::Type axis, double value ) = 0;
00147 
00149   virtual double calcBinWidth ( const std::string & axis,
00150                                 int parm,
00151                                 bool dragging ) const = 0;
00152 
00154   virtual double calcOffset ( const std::string &,
00155                               int parm,
00156                               bool dragging ) const = 0;
00157 
00159   virtual double getOffset ( hippodraw::Axes::Type axis ) const = 0;
00160 
00163   virtual void setOffset ( hippodraw::Axes::Type axis, double value ) = 0;
00164 
00169   virtual const Range & setRange ( hippodraw::Axes::Type axis, 
00170                                    const Range &, 
00171                                    bool hold_width = true ) = 0;
00172 
00173   virtual const Range & getRange ( hippodraw::Axes::Type axis ) = 0;
00174 
00179   virtual void accumulate ( double x, double w_or_y = 1.0, 
00180                             double z = 1.0, double w = 1.0 ) = 0;
00181 
00183   virtual double getZValue ( double x, double y ) const;
00184 
00188   virtual NTuple * prepareNTuple ( unsigned int rows ) const = 0;
00189 
00195   virtual NTuple * createNTuple () const = 0;
00196 
00200   virtual void fillProjectedValues ( DataSource * ntuple ) const = 0;
00201 
00207   virtual void fillDataSource ( DataSource * ntuple ) const = 0;
00208 
00214   virtual void setBinContents ( const DataSource * ntuple ) = 0;
00215 
00216 
00217 };
00218 
00219 #endif // _BinsBase_H_

Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3