Path: blob/devel/ElmerGUI/Application/src/convergenceview.h
3203 views
/*****************************************************************************1* *2* Elmer, A Finite Element Software for Multiphysical Problems *3* *4* Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland *5* *6* This program is free software; you can redistribute it and/or *7* modify it under the terms of the GNU General Public License *8* as published by the Free Software Foundation; either version 2 *9* of the License, or (at your option) any later version. *10* *11* This program is distributed in the hope that it will be useful, *12* but WITHOUT ANY WARRANTY; without even the implied warranty of *13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *14* GNU General Public License for more details. *15* *16* You should have received a copy of the GNU General Public License *17* along with this program (in file fem/GPL-2); if not, write to the *18* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *19* Boston, MA 02110-1301, USA. *20* *21*****************************************************************************/2223/*****************************************************************************24* *25* ElmerGUI convergenceview *26* *27*****************************************************************************28* *29* Authors: Mikko Lyly, Juha Ruokolainen and Peter Råback *30* Email: [email protected] *31* Web: http://www.csc.fi/elmer *32* Address: CSC - IT Center for Science Ltd. *33* Keilaranta 14 *34* 02101 Espoo, Finland *35* *36* Original Date: 15 Mar 2008 *37* *38*****************************************************************************/3940#ifndef CONVERGENCEVIEW_H41#define CONVERGENCEVIEW_H4243#include <QMainWindow>44#include <QHash>45#include <QIcon>46#include "maxlimits.h"4748#include <qwt_plot.h>49#include <qwt_plot_marker.h>50#include <qwt_plot_curve.h>51#include <qwt_plot_grid.h>52#include <qwt_legend.h>53/*#include <qwt_data.h> <-- deprecated in Qwt6, using qwt_compat.h instead54#include <qwt_compat.h> <-- Removed in Qwt 6.2 */55#include <qwt_text.h>56#include <qwt_scale_engine.h>5758#define MAX_NOF_PENS 2559#if QWT_VERSION >= 0x06010060#define QwtLog10ScaleEngine QwtLogScaleEngine61#endif626364class CurveData65{66public:67CurveData();6869void append(double*, double*, int);7071int count() const;72int size() const;73const double *x() const;74const double *y() const;7576private:77int d_count;78QVector<double> d_x;79QVector<double> d_y;80};8182class Curve83{84public:85CurveData *d_data;86QwtPlotCurve *d_curve;87};8889class ConvergenceView : public QMainWindow90{91Q_OBJECT9293public:94ConvergenceView(Limit *limit, QWidget *parent = 0);95~ConvergenceView();9697QSize minimumSizeHint() const;98QSize sizeHint() const;99100void appendData(double, QString);101void appendData(double*, int, QString);102void removeData();103104QString title;105106private slots:107void savePictureSlot();108void showGridSlot();109void showLegendSlot();110void showNSHistorySlot();111void showSSHistorySlot();112void clearHistorySlot();113114private:115QwtPlot *plot;116QwtPlotGrid *grid;117QwtLegend *legend;118QwtLog10ScaleEngine *scaleEngine;119120QHash<QString, Curve*> curveList;121QPen *pen;122123QAction *savePictureAct;124QAction *exitAct;125QAction *showGridAct;126QAction *showLegendAct;127QAction *showNSHistoryAct;128QAction *showSSHistoryAct;129QAction *clearHistoryAct;130131QMenu *fileMenu;132QMenu *viewMenu;133134QToolBar *fileToolBar;135QToolBar *viewToolBar;136137void createActions();138void createMenus();139void createToolBars();140void createStatusBar();141142bool showGrid;143bool showLegend;144bool showNSHistory;145bool showSSHistory;146147QIcon iconChecked;148};149150#endif // CONVERGENCEVIEW_H151152153