CompositePlotter.h

Go to the documentation of this file.
00001 /* -*- mode: c++ -*- */
00002 
00014 #ifndef _CompositePlotter_H_
00015 #define _CompositePlotter_H_
00016 
00017 #include "axes/AxesType.h"
00018 
00019 #include <vector>
00020 
00021 namespace hippodraw {
00022 
00023 class AxisRepBase;
00024 class AxisModelBase;
00025 class AxisTick;
00026 class BinToColor;
00027 class DataRep;
00028 class Color;
00029 class NTuple;
00030 class ProjectorBase;
00031 class Range;
00032 class Rect;
00033 class RepBase;
00034 class TransformBase;
00035 class TupleCut;
00036 class ViewBase;
00037 
00054 class MDL_HIPPOPLOT_API CompositePlotter
00055 {
00056 
00057 protected:
00058 
00062   CompositePlotter( const CompositePlotter & plotter );
00063 
00072   AxisModelBase * m_x_axis;
00073   
00078   AxisModelBase * m_y_axis;
00079   
00084   AxisModelBase * m_z_axis;
00085   
00091   std::string m_x_label;
00092   
00095   std::string m_y_label;
00096   
00099   std::string m_z_label;
00100   
00103   TransformBase * m_transform;
00104 
00107   TransformBase * m_fits_transform;
00108   
00112   int m_datarep_index;
00113 
00116   typedef std::vector < hippodraw::DataRep * > DataRepList_t;
00117 
00119   DataRepList_t m_datareps;
00120 
00124   bool m_has_autoscaled;
00125 
00128   bool m_show_grid;
00129 
00132   bool m_box_edge;
00133   
00137   bool m_has_z;
00138 
00141   bool m_reverse;
00142 
00145   bool isDirty () const;
00146 
00152   virtual double getZValue ( double x, double y, bool scaled = true ) const;
00153 
00155   void push_back ( hippodraw::DataRep * );
00156 
00157   virtual void setRangePrivate ( hippodraw::Axes::Type axis, 
00158                                  const Range & range,
00159                                  bool scaled = false, 
00160                                  bool adjust_width = true );
00161 
00162 public:
00163 
00166   CompositePlotter ( );
00167 
00170   virtual ~CompositePlotter ();
00171 
00174   CompositePlotter * clone ();
00175 
00181   virtual void setAllAxisModels ();
00182 
00186   bool  checkAutoScale ();
00187 
00193   virtual void autoScale ( );
00194 
00197   void autoScale ( hippodraw::Axes::Type axis );
00198 
00202   void autoScaleZ ();
00203 
00204   virtual void setRange ( hippodraw::Axes::Type, const Range &, 
00205                           bool scaled, bool adjust_width );
00206 
00207   virtual void setNumberOfBins ( hippodraw::Axes::Type axis, 
00208                                  unsigned int number );
00209 
00212   virtual void setRepresentation ( RepBase * pointrep );
00213 
00216   virtual RepBase * representation ( ) const;
00217 
00218   virtual const BinToColor * getValueRep () const;
00219 
00223   virtual void setValueRep ( BinToColor * rep );
00224 
00226   virtual ProjectorBase * activeProjector () const;
00227 
00230   virtual ProjectorBase * getProjector (int i) const;
00231 
00233   virtual int getNumDataReps () const;
00234 
00237   virtual hippodraw::DataRep * getParentDataRep ( int index ) const;
00238   
00240   virtual hippodraw::DataRep * getParentDataRep () const;
00241   
00244   virtual void setParentDataRep ( int index, hippodraw::DataRep * parent );
00245 
00247   virtual void setParentDataRep ( hippodraw::DataRep * parent );
00248   
00249   virtual hippodraw::DataRep * getDataRep ( int index ) const;
00250 
00254   virtual hippodraw::DataRep * selectedDataRep () const;
00255 
00258   virtual hippodraw::DataRep * mouseSelectedDataRep () const;
00259 
00263   virtual void addDataRep ( hippodraw::DataRep * rep );
00264 
00268   virtual bool hasNTupleBindings () const;
00269 
00273   virtual bool hasZoomY () const;
00274 
00275 
00282   virtual int setActivePlot( int index, bool redraw );
00283 
00289   virtual int activePlotIndex () const;
00290 
00292   virtual void removeDataRep ( hippodraw::DataRep * );
00293 
00296   virtual void setAxisModel ( AxisModelBase * , hippodraw::Axes::Type );
00297 
00300   virtual void setAutoRanging ( bool flag );
00301 
00304   virtual void setShowGrid ( bool flag );
00305 
00308   virtual bool getShowGrid ();
00309 
00312   virtual void setBoxEdge( bool flag );
00313 
00316   virtual bool getBoxEdge();
00317 
00321   virtual void setErrorDisplay ( hippodraw::Axes::Type axis, bool );
00322 
00326   virtual bool errorDisplay ( hippodraw::Axes::Type axis ) const;
00327 
00328   virtual void matrixTranspose ( bool yes );
00329 
00332   virtual void setRepColor ( const Color & );
00333 
00337   virtual const Color & repColor () const;
00338 
00346   virtual double getBinWidth (hippodraw::Axes::Type axis) const;
00347 
00348   virtual void setOffset ( hippodraw::Axes::Type axis, double offset );
00349 
00353   virtual void setBinWidth ( hippodraw::Axes::Type axis, double width );
00354 
00356   virtual void reset ();
00357 
00358   virtual double getOffset (hippodraw::Axes::Type axis) const;
00359 
00364   virtual int getNumberOfEntries () const;
00365 
00367   virtual double getPosRange ( hippodraw::Axes::Type axis ) const;
00368 
00378   virtual void setTransform ( TransformBase * );
00379 
00381   virtual void setFitsTransform ( const std::string & );
00382 
00383   virtual void toUserXY ( double mx, double my, bool scaled, 
00384                                 double & ux, double & uy ) const;
00385 
00390   virtual NTuple * createNTuple () const;
00391 
00404   virtual NTuple * createPickTuple ();
00405 
00420   virtual void fillPickedPoint ( double mx, double my, 
00421                                  std::vector < double > & picked ) const;
00422 
00424   double processReturnValue ( double retval, 
00425                               hippodraw::Axes::Type axis, 
00426                               bool scaled ) const;
00427 
00433   virtual void addValues ( const std::vector < double > &  v );
00434 
00435   virtual void update ();
00436 
00439   virtual void setAutoTicks ( hippodraw::Axes::Type axis, bool yes );
00440 
00441   virtual void setTicks ( hippodraw::Axes::Type axis, 
00442                           const std::vector < AxisTick > & ticks );
00443 
00444   virtual bool isTargetable () const;
00445   virtual hippodraw::DataRep * getTarget () const;
00446   virtual int indexOf ( const hippodraw::DataRep * rep ) const;
00447   virtual bool hasAxis ( hippodraw::Axes::Type axis ) const;
00448   virtual bool isAxisScaled ( hippodraw::Axes::Type axis ) const;
00449   virtual AxisModelBase * getAxisModel ( hippodraw::Axes::Type axis ) const;
00450 
00455   virtual void setAutoRanging ( hippodraw::Axes::Type axis, bool flag );
00456 
00457   virtual bool isAutoRanging ( hippodraw::Axes::Type axis ) const;
00458 
00461   virtual void setReverse ( bool flag );
00462 
00463   virtual bool isReverse ( ) const;
00464 
00467   virtual void setLowRange ( hippodraw::Axes::Type axis, int parm, 
00468                              bool dragging );
00469 
00472   virtual void setHighRange ( hippodraw::Axes::Type axis, int parm, 
00473                               bool dragging );
00474 
00475   virtual const Range & getRange ( hippodraw::Axes::Type axis, 
00476                                    bool scaled ) const;
00477   virtual void setScaleFactor ( hippodraw::Axes::Type  axis, double factor );
00478 
00481   virtual void setScaling ( hippodraw::Axes::Type  axis, bool on = true );
00482 
00487   void setTitle ( const std::string & title );
00488 
00493   const std::string & getTitle () const;
00494 
00495   virtual void setLabel ( hippodraw::Axes::Type, const std::string & value );
00496   virtual const std::string & getLabel ( hippodraw::Axes::Type ) const;
00497   virtual const std::string &
00498   getInternalLabel ( hippodraw::Axes::Type axis ) const;
00499 
00500   virtual TransformBase * getTransform () const;
00501 
00502   virtual TransformBase * getFitsTransform () const;
00503 
00510   virtual double getAspectRatio () const;
00511 
00514   bool hasAutoScaled () const;
00515 
00518   virtual void prepareToDraw ();
00519 
00522   Rect calcUserRectangle () const;
00523 
00526   Rect calcRawRectangle() const;
00527 
00533   virtual void drawProjValues( ViewBase * view );
00534 
00540   void drawAxisRep ( AxisRepBase * rep, ViewBase * view,
00541                      bool do_y, bool do_z );
00542 
00545   virtual void checkAxisScaling ();
00546 
00549   void setEnableZ ( bool yes );
00550 
00553   void setAutoScaled ( bool flag = true );
00554 
00556   void autoScale ( AxisModelBase * model, hippodraw::Axes::Type axis );
00557 
00561   void fillCutList ( std::vector < const TupleCut * > & cuts ) const;
00562 
00566   virtual void setCutRangeAt ( const Range & range, unsigned int index );
00567 
00570   virtual void setMinEntries( int entries );
00571 
00572 
00575   virtual int getMinEntries ();
00576 
00581   bool isImageConvertable () const;
00582 
00583 private:
00584 
00588   void toggleBoxEdge(DataRep* datarep);
00589 
00590 };
00591 
00592 } // namespace hippodraw
00593 
00594 #endif // _CompositePlotter_H_

Generated for HippoDraw Class Library by doxygen