PlotAxis.h

00001 
00008 #ifndef _PlotAxis_h
00009 #define _PlotAxis_h
00010 
00011 // SYSTEM INCLUDES
00012 //
00013 
00014 // PROJECT INCLUDES
00015 //
00016 
00017 // LOCAL INCLUDES
00018 //
00019 #include "ui_util.h"
00020 
00021 // FORWARD REFERENCES
00022 //
00023 
00024 class PlotAxis
00025 {
00026 public:
00027 // LIFECYCLE
00028 
00035     PlotAxis(bool vertical, bool limitToIntegers = false);
00036 
00037 
00040     ~PlotAxis(void);
00041 
00042 
00043 // OPERATORS
00044 // OPERATIONS
00045 
00048     const wxBitmap&     Draw() const;
00049 
00054     void                Resize(wxCoord newLength);
00055 
00058     void                Zoom(double start, double end);
00059 
00065     void                Displace(wxCoord x);
00066 
00067 // ACCESS
00068 
00074     // TODO: zastanowić się nad nazwą.
00075     wxCoord             Breadth() const;
00076 
00081     wxCoord             Length() const;
00082 
00085     void                SetLabel(const wxString& label);
00086 
00089     bool&               IntegersOnly();
00090 
00091 // INQUIRY
00092 
00093 protected:
00094 private:
00095 
00097     class TextSizeIntervalCountLimiter
00098         : public IntervalCountLimiter
00099     {
00100     public:
00101         TextSizeIntervalCountLimiter(double     plotStart,
00102                                      double     plotEnd,
00103                                      unsigned   pixelLength,
00104                                      bool       vertical,
00105                                      bool       limitToIntegers = false);
00106 
00107         virtual unsigned    operator()(double intervalLength) const;
00108     private:
00109         double      mPlotStart;
00110         double      mPlotEnd;
00111         unsigned    mPixelLength;
00112         bool        mVertical;
00113         bool        mLimitToIntegers;
00114     };
00115 
00118     void                Redraw();
00119 
00122     void                DrawLabel(wxDC& dc);
00123 
00126     void                UpdateStubInterval();
00127 
00128     bool        mVertical;
00129 
00130     wxString    mLabel;     
00131 
00132     double  mPlotStart;     
00133     double  mPlotEnd;       
00134     wxCoord mPixelLength;   
00135 
00136     wxCoord mDisplacement;
00137 
00138     double  mStubInterval;  
00139 
00140     wxBitmap    mAxisBitmap;    
00141 
00142     wxFont  mAxisFont;          
00143     wxFont  mLabelFont;         
00144 
00145     bool    mLimitToIntegers;   
00146 };
00147 
00148 // INLINE METHODS
00149 //
00150 
00151 // EXTERNAL REFERENCES
00152 //
00153 
00154 #endif  // _PlotAxis_h

Wygenerowano Fri Sep 29 21:04:49 2006 dla EduOptim2 programem  doxygen 1.4.6