AxisModelBase.h

Go to the documentation of this file.
00001 /* -*- mode: c++; -*- */
00002 
00014 #ifndef _AxisModelBase_H_
00015 #define _AxisModelBase_H_
00016 
00017 #include "AxisLoc.h"
00018 #include "Range.h"
00019 
00020 namespace hippodraw {
00021 
00022 class AxisTick;
00023 
00033 class MDL_HIPPOPLOT_API AxisModelBase
00034 {
00035 protected:
00036 
00038   Range m_range;
00039 
00041   mutable Range m_scaled_range;
00042 
00046   Range m_start_range;
00047 
00049   bool m_is_dragging;
00050 
00053   bool m_auto_range;
00054 
00056   bool m_empty;
00057 
00062   double m_scale_factor;
00063 
00065   bool m_scaling_on;
00066 
00070   double m_first_tick;
00071   
00074   double m_tick_step;
00075   
00077   const int m_max_ticks;
00078 
00079   //The actual program doesn't represent nor support any minor
00080   //ticks.
00081   int m_num_minor_ticks; // The Number of minor ticks between the major ones.
00082 
00083   AxisLoc m_label_location;
00084   AxisLoc m_scale_location;
00085   
00088   double m_pmag;
00089 
00093   bool m_use_pmag;
00094   
00097   double m_rmag;
00098 
00100   std::vector<AxisTick> m_ticks;
00101 
00103   std::vector<AxisTick> m_ticks_in_range;
00104   
00108   bool m_auto_ticks;
00109 
00112   void startDragging ( bool dragging );
00113   
00114 public:
00115 
00118   AxisModelBase ( AxisLoc label, AxisLoc scale );
00119 
00121   AxisModelBase( const AxisModelBase & axis_model );
00122   
00124   virtual ~AxisModelBase();
00125 
00127   virtual AxisModelBase * clone () const = 0;
00128 
00129 
00131   void setTickStep( const double & t_step );
00132   
00135   double getTickStep() const;
00136 
00138   void setFirstTick( const double & first_tick );
00139  
00141   double getFirstTick() const;
00142 
00144   double getMaxTicks() const;
00145   
00147   void setRMag ( const double & rmag );
00148   
00150   double getRMag() const;
00151 
00153   void setPMag( const double & pmag );
00154   
00156   double getPMag() const;
00157 
00158 
00160   void setRange ( double low, double high, double pos );
00161 
00165   void setRange ( const Range &, bool scaled = false );
00166 
00168   void setIntersectRange ( const Range &, const Range & );
00169 
00171   void setRangePos ( double );
00172 
00176   void setUnionRange ( const Range & range );
00177 
00179   void setEmpty ();
00180 
00187   const Range & getRange ( bool scaled ) const;
00188 
00190   void setAutoRanging ( bool flag );
00191 
00194   bool isAutoRanging ( ) const;
00195 
00197   void setScaleFactor ( double );
00198 
00201   double getScaleFactor () const;
00202 
00206   bool isScaling () const;
00207 
00209   void setScaling ( bool on = true );
00210 
00220   virtual bool needPMag () const;
00221 
00223   virtual void setUsePMag( const bool & use_p_mag );
00224   
00228   virtual bool isLog() const = 0;
00229 
00230   AxisLoc getLabelLocation() const;
00231   AxisLoc getScaleLocation() const;
00232 
00234   void setTicks( const std::vector<AxisTick> & ticks);
00235 
00239   const std::vector<AxisTick> & getTicks() const;
00240 
00244   void adjustTicks();
00245 
00249   void setAutoTicks ( bool yes );
00250 
00254   bool isAutoTicks () const;
00255 
00258   virtual const Range & adjustValues ( const Range & limit ) = 0;
00259 
00261   virtual const Range & adjustLogValues() = 0;
00262 
00269   virtual Range calcLow ( int parm, bool dragging = false ) = 0;
00270 
00277   virtual Range calcHigh ( int parm, bool dragging = false ) = 0;
00278   
00279 };
00280 
00281 } // namespace hippodraw
00282 
00283 #endif // _AxisModel_H_

Generated for HippoDraw Class Library by doxygen