00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: regularData2DWidget.h,v 1.13.16.1 2007/03/25 21:26:24 oliver Exp $ 00005 // 00006 00007 #ifndef BALL_VIEW_WIDGETS_REGULARDATA2DWIDGET_H 00008 #define BALL_VIEW_WIDGETS_REGULARDATA2DWIDGET_H 00009 00010 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H 00011 # include <BALL/VIEW/KERNEL/modularWidget.h> 00012 #endif 00013 00014 #ifndef BALL_VIEW_WIDGETS_CANVASWIDGET_H 00015 # include <BALL/VIEW/WIDGETS/canvasWidget.h> 00016 #endif 00017 00018 #ifndef BALL_DATATYPE_REGULARDATA2D_H 00019 # include <BALL/DATATYPE/regularData2D.h> 00020 #endif 00021 00022 #ifndef BALL_VIEW_WIDGETS_DOCKWIDGET_H 00023 # include <BALL/VIEW/WIDGETS/dockWidget.h> 00024 #endif 00025 00026 #include <QtGui/qcolor.h> 00027 //Added by qt3to4: 00028 #include <QContextMenuEvent> 00029 #include <QResizeEvent> 00030 00031 namespace BALL 00032 { 00033 namespace VIEW 00034 { 00038 class BALL_VIEW_EXPORT RegularData2DWidget 00039 : public CanvasWidget, 00040 public ModularWidget 00041 { 00042 Q_OBJECT 00043 00044 public: 00045 00046 BALL_EMBEDDABLE(RegularData2DWidget, ModularWidget) 00047 00048 00049 RegularData2DWidget(const RegularData2D* data, QWidget *parent = 0); 00050 00052 ~RegularData2DWidget(); 00053 00057 virtual void onNotify(Message *message); 00058 00059 public slots: 00060 00062 void createPlot(); 00063 00064 protected: 00065 00066 RegularData2DWidget(RegularData2DWidget* widget); 00067 00068 const RegularData2D* data_; 00069 QColor diagram_color_; 00070 QColor background_color_; 00071 QColor axis_color_; 00072 }; 00073 00074 00076 class BALL_VIEW_EXPORT DockableRegularData2DWidget 00077 : public DockWidget 00078 { 00079 Q_OBJECT 00080 00081 public: 00082 00084 DockableRegularData2DWidget(const RegularData2D* data, QWidget *parent=0 ); 00085 00087 ~DockableRegularData2DWidget(); 00088 00090 void plot(); 00091 00092 public slots: 00093 00095 virtual void zoomToFit(); 00096 00098 virtual void zoomIn(); 00099 00101 virtual void zoomOut(); 00102 00103 00104 protected slots: 00105 virtual void resizeEvent(QResizeEvent* e); 00106 virtual void contextMenuEvent(QContextMenuEvent* e); 00107 00108 protected: 00109 DockableRegularData2DWidget(const DockableRegularData2DWidget& dockcanwid); 00110 QSize sizeHint() const; 00111 00112 RegularData2DWidget canWidget_; 00113 }; 00114 00115 } //end of namespace VIEW 00116 }//end of namespace BALL 00117 00118 #endif // BALL_VIEW_WIDGETS_DOCKWIDGET_H