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