Home

Download

Features

Screenshots

Handbook

Browse Source

Authors

SourceForge.net Logo
Hosted by SourceForge.net

OSI Certified


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages   Search  

statplotgraph.h

00001 /***************************************************************************
00002                           statplotgraph.h  -  description
00003                              -------------------
00004     begin                : Sun Jun 2 2002 -- redone : Fri Oct 11 2002
00005     copyright            : (C) 2002-03 by Fungmeista
00006     email                : mizunoami44@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef STATPLOTGRAPH_H
00019 #define STATPLOTGRAPH_H
00020 
00021 #include <vector>
00022 
00023 #include "basicgraph.h"
00024 
00025 class PlotModule;
00026 
00032 class StatPlotGraph : public BasicGraph
00033 {
00034     Q_OBJECT
00035     public: 
00036         StatPlotGraph(QWidget *parent=0, const char *name=0);
00037         ~StatPlotGraph();
00038         static const unsigned int ERROR_EMPTY_XLIST = 0;
00039         static const unsigned int ERROR_EMPTY_YLIST = 1;
00040 
00041         inline unsigned int getCurrentPlotIndex() const{return plotIndex;}
00042         
00043         #ifdef KDE_APP
00044         virtual void print(KPrinter *);
00045         #else
00046         virtual void print(QPrinter *);
00047         #endif //KDE_APP
00048 
00049         void exportAsImage(const QString&,const QString&);
00050         void getPixmap(QPixmap &pm);
00051 
00052     public slots:
00053         void nextPlot();
00054         void prevPlot();
00055         void zoomStat();
00056         void setTrace(bool b){doTrace = b;}
00057         bool isTracing() const{return doTrace;}
00058         virtual inline int getGraphType() const{return STATGRAPH;}
00059         void addPlot(unsigned int index, PlotModule *);
00060         void removePlot(unsigned int index);
00061         inline void setActivePlot(unsigned int plot){plotIndex = plot; repaint(false);}
00062         void setShowCurrentPlot(bool show);
00063         QColor getColor(unsigned int i) const;
00064 
00065     protected:
00066         friend class PlotModule;
00067     
00068         void updateCoords();
00069 
00070         //events
00071         void paintEvent(QPaintEvent*);
00072         void mouseMoveEvent(QMouseEvent *m);
00073 
00074     private:
00075         unsigned int plotIndex;
00076 
00077         std::vector<PlotModule*> plots;
00078         void drawPlots(QPainter*);
00079         bool doTrace;
00080 };
00081 
00082 #endif