plotzoom.h

00001 #include <qobject.h>
00002 #include <qimage.h>
00003 #include <qapplication.h>
00004 #include <qpainter.h>
00005 #include <qwidget.h>
00006 #include <qradiobutton.h>
00007 #include <qbuttongroup.h>
00008 #include <qpushbutton.h>
00009 #include <qlayout.h>
00010 #include <qfiledialog.h>
00011 // #include <qpopupmenu.h>
00012 #include <qmenubar.h>
00013 
00014 #include <iostream>
00015 
00016 // colors.h comes from pngmanip
00017 // so be careful to keep 'em sync'd
00018 #include "Curve.h"
00019 
00020 using namespace std;
00021 
00022 enum PLOT_TYPE { PT_PLOT = 1, PP_PLOT, TT_PLOT };
00023 
00024 typedef struct Pl {
00025   QImage img;
00026   float fromx,fromy,tox,toy;
00027 } Pl;
00028 
00029 class Plot : public QWidget {
00030   Q_OBJECT
00031 
00032   int oldfx,oldfy,oldtx,oldty;
00033 
00034   int FileLoaded;
00035   int mbarh;
00036   Pl plots[10];
00037   int Depth;
00038   Curve<Vector3>* curve;
00039   QWidget *plotwin;
00040   int clickx,clicky,movex,movey;
00041   float fx,fy,tx,ty;
00042   int w,h;
00043   float length,thickness,alen,ptmin,ptmax,cur;
00044   float oldlength,sigma_i,sigma_j;
00045   // ptplot uses fromx,fromy,tox and toy;
00046   void ptplot();
00047   void loadPKF(QString filename);
00048 
00049   // MenuBar
00050   QMenuBar *menubar;
00051   QPopupMenu *file;
00052 
00053 public:
00054   int height();
00055   PLOT_TYPE ptype;
00056   QButtonGroup *bg;
00057   ~Plot();
00058   Plot(const char* pkfname = NULL, int w = 500, int h = 500,
00059        PLOT_TYPE type = PT_PLOT, QWidget *parent = 0);
00060   int SIZE;
00061 public slots:
00062   void test(int id);
00063   void zoomout();
00064   void openFile();
00065 protected:
00066   void paintEvent(QPaintEvent *e);
00067   void keyReleaseEvent ( QKeyEvent *e);
00068   void mousePressEvent ( QMouseEvent *e );
00069   void mouseReleaseEvent (QMouseEvent *e);
00070   void mouseMoveEvent( QMouseEvent *e);
00071 };
00072 

Generated on Mon Feb 8 17:22:35 2010 for libbiarc by  doxygen 1.5.6