00001 #ifndef _UnivariatePlot_h 00002 #define _UnivariatePlot_h 00003 00004 #include "../UnivariateFunction.h" 00005 #include "PlotControl.h" 00006 00007 class UnivariatePlot 00008 : public PlotControl 00009 { 00010 public: 00011 enum ToolType 00012 { 00013 PAN, 00014 ZOOM_IN, 00015 ZOOM_OUT 00016 }; 00017 00018 UnivariatePlot( 00019 wxWindow* pParent, 00020 wxWindowID id, 00021 const UnivariateFunction& function, 00022 PlotStatus* pPlotStatus = NULL, 00023 const wxString& variableName = wxT(""), 00024 const wxPoint& position = wxDefaultPosition, 00025 const wxSize& size = wxDefaultSize, 00026 bool integersOnX = false); 00027 00028 ~UnivariatePlot(); 00029 00030 virtual void OnAspectChange(bool redraw); 00031 protected: 00032 00033 virtual void DrawDisplaced(long x, long y); 00034 00035 virtual void Pan(wxCoord x, wxCoord y); 00036 00037 virtual void PlotFunction(wxDC& dc); 00038 00039 virtual void ZoomIn(wxCoord x, wxCoord y); 00040 virtual void ZoomRegionIn(wxCoord x, 00041 wxCoord y, 00042 wxCoord width, 00043 wxCoord height); 00044 virtual void ZoomOut(wxCoord x, wxCoord y); 00045 00046 virtual void UpdateStatusOnMove(long x, long y); 00047 00048 virtual void UpdateScale(); 00049 00050 private: 00051 void UpdateYBounds(); 00052 }; 00053 00054 #endif