ApplicationWindow.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : ApplicationWindow.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2006 by Ion Vasilief,
00006                            Tilman Hoener zu Siederdissen,
00007                            Knut Franke
00008     Email (use @ for *)  : ion_vasilief*yahoo.fr, thzs*gmx.net,
00009                            knut.franke*gmx.de
00010     Description          : QtiPlot's main window
00011 
00012  ***************************************************************************/
00013 
00014 /***************************************************************************
00015  *                                                                         *
00016  *  This program is free software; you can redistribute it and/or modify   *
00017  *  it under the terms of the GNU General Public License as published by   *
00018  *  the Free Software Foundation; either version 2 of the License, or      *
00019  *  (at your option) any later version.                                    *
00020  *                                                                         *
00021  *  This program is distributed in the hope that it will be useful,        *
00022  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00023  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00024  *  GNU General Public License for more details.                           *
00025  *                                                                         *
00026  *   You should have received a copy of the GNU General Public License     *
00027  *   along with this program; if not, write to the Free Software           *
00028  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00029  *   Boston, MA  02110-1301  USA                                           *
00030  *                                                                         *
00031  ***************************************************************************/
00032 #ifndef APPLICATION_H
00033 #define APPLICATION_H
00034 
00035 #include <QMainWindow>
00036 #include <q3listview.h>
00037 #include <QHttp>
00038 #include <QFile>
00039 #include <QSplitter>
00040 #include <QDesktopServices>
00041 #include <QBuffer>
00042 #include <QLocale>
00043 
00044 #include "Table.h"
00045 #include "ScriptingEnv.h"
00046 #include "Script.h"
00047 
00048 class QPixmap;
00049 class QCloseEvent;
00050 class QDropEvent;
00051 class QTimerEvent;
00052 class QDragEnterEvent;
00053 class QTranslator;
00054 class QDockWidget;
00055 class QAction;
00056 class QActionGroup;
00057 class QLineEdit;
00058 class QTranslator;
00059 class QToolButton;
00060 class QShortcut;
00061 class QMenu;
00062 class QToolBar;
00063 class QAssistantClient;
00064 class QLocale;
00065 class QMdiArea;
00066 class QUndoView;
00067 class QCompleter;
00068 
00069 class Matrix;
00070 class Table;
00071 class Graph;
00072 class ScalePicker;
00073 class Graph3D;
00074 class Note;
00075 class MultiLayer;
00076 class FunctionDialog;
00077 class Folder;
00078 class FolderListItem;
00079 class FolderListView;
00080 class ScriptWindow;
00081 class Plot3DDialog;
00082 class TableStatistics;
00083 class CurveRangeDialog;
00084 class LegendWidget;
00085 class ArrowMarker;
00086 class ImageMarker;
00087 class TextEditor;
00088 class AssociationsDialog;
00089 
00118 class ApplicationWindow: public QMainWindow, public scripted
00119 {
00120     Q_OBJECT
00121 public:
00122     ApplicationWindow(bool factorySettings = false);
00123     ApplicationWindow(const QStringList& l);
00124     ~ApplicationWindow();
00125 
00126     enum ShowWindowsPolicy{HideAll, ActiveFolder, SubFolders};
00127     enum WindowType{NoWindow, TableWindow, MatrixWindow, MultiLayerWindow, NoteWindow, Plot3DWindow};
00128     enum MatrixToTableConversion{Direct, XYZ, YXZ};
00129     enum EndLineChar{LF, CRLF, CR};
00130     enum Analysis{NoAnalysis, Integrate, Diff, FitLinear, FitGauss, FitLorentz, FitSigmoidal};
00131 
00132     FolderListView *lv, *folders;
00133     QDockWidget *logWindow;
00134 
00139     QString generateUniqueName(const QString& name, bool increment = true);
00140     void saveFitFunctions(const QStringList& lst);
00141 
00143 
00144     void loadCustomActions();
00145     void reloadCustomActions();
00146     void removeCustomAction(QAction *);
00147     void addCustomAction(QAction *, const QString& parentName, int index = -1);
00148     QList<QAction *> customActionsList(){return d_user_actions;};
00149     QList<QMenu *> customizableMenusList();
00151 
00152     QList<QMenu *> menusList();
00153     QList<QToolBar *> toolBarsList();
00154 
00155     MdiSubWindow *activeWindow(WindowType type = NoWindow);
00156 
00157     int matrixUndoStackSize(){return d_matrix_undo_stack_size;};
00158     void setMatrixUndoStackSize(int size);
00159 
00160     QString endOfLine();
00161     bool autoUpdateTableValues(){return d_auto_update_table_values;};
00162     void setAutoUpdateTableValues(bool on = true);
00163 
00164     QCompleter* completer(){return d_completer;};
00165     void enableCompletion(bool on = true);
00166 
00167 public slots:
00169 
00170     void open();
00171     ApplicationWindow* open(const QString& fn, bool factorySettings = false, bool newProject = true);
00172     ApplicationWindow* openProject(const QString& fn, bool factorySettings = false, bool newProject = true);
00173     ApplicationWindow* importOPJ(const QString& fn, bool factorySettings = false, bool newProject = true);
00174 
00182     ApplicationWindow * plotFile(const QString& fn);
00183 
00190     ApplicationWindow * loadScript(const QString& fn, bool execute = false, bool factorySettings = false);
00191 
00192     QList<MdiSubWindow *> windowsList();
00193     void updateWindowLists(MdiSubWindow *w);
00197     void cascade();
00198 
00199     void saveProjectAs(const QString& fileName = QString(), bool compress = false);
00200     bool saveProject(bool compress = false);
00201 
00203     void modifiedProject();
00205     void savedProject();
00207     void modifiedProject(MdiSubWindow *w);
00209 
00211 
00212     void readSettings();
00213     void saveSettings();
00214     void setSaveSettings(bool autoSaving, int min);
00215     void changeAppStyle(const QString& s);
00216     void changeAppFont(const QFont& f);
00217     void updateAppFonts();
00218     void setAppColors(const QColor& wc,const QColor& pc,const QColor& tpc, bool force = false);
00219 
00220     QLocale locale(){return d_locale;};
00221     void setLocale(const QLocale& l){d_locale = l;};
00222 
00223     void initWindow();
00225 
00227 
00228 
00229     MultiLayer* newGraph(const QString& caption = tr("Graph"));
00230     MultiLayer* multilayerPlot(int c, int r, int style);
00231     MultiLayer* multilayerPlot(Table* w, const QStringList& colList, int style, int startRow = 0, int endRow = -1);
00233     MultiLayer* multilayerPlot(const QString& caption, int layers = 1, int rows = 1, int cols = 1);
00235     MultiLayer* multilayerPlot(const QStringList& colList);
00236     void connectMultilayerPlot(MultiLayer *g);
00237     void addLayer();
00238     void deleteLayer();
00239 
00241     MultiLayer* plotSpectrogram(Matrix *m, Graph::CurveType type);
00242     MultiLayer* plotGrayScale(Matrix *m = 0);
00243     MultiLayer* plotContour(Matrix *m = 0);
00244     MultiLayer* plotColorMap(Matrix *m = 0);
00245     MultiLayer* plotImage(Matrix *m = 0);
00246 
00248     void autoArrangeLayers();
00249     void initMultilayerPlot(MultiLayer* g, const QString& name);
00250     void polishGraph(Graph *g, int style);
00251     void plot2VerticalLayers();
00252     void plot2HorizontalLayers();
00253     void plot4Layers();
00254     void plotStackedLayers();
00255     void plotStackedHistograms();
00257 
00259 
00260     Graph3D* newPlot3D();
00261     Graph3D* openMatrixPlot3D(const QString& caption, const QString& matrix_name,
00262                              double xl,double xr,double yl,double yr,double zl,double zr);
00263     Graph3D* plotXYZ(Table* table,const QString& zColName, int type);
00264         //when reading from .qti file
00265     Graph3D* dataPlot3D(const QString& caption,const QString& formula,
00266                         double xl, double xr, double yl, double yr, double zl, double zr);
00267     Graph3D* openPlotXYZ(const QString& caption,const QString& formula,
00268                         double xl, double xr, double yl, double yr, double zl, double zr);
00270 
00272 
00273     Graph3D* plotSurface(const QString& formula, double xl, double xr,
00274                        double yl, double yr, double zl, double zr, int columns = 40, int rows = 30);
00275     Graph3D* plotParametricSurface(const QString& xFormula, const QString& yFormula,
00276                         const QString& zFormula, double ul, double ur, double vl, double vr,
00277                         int columns, int rows, bool uPeriodic, bool vPeriodic);
00278 
00279     void connectSurfacePlot(Graph3D *plot);
00280     void newSurfacePlot();
00281     void editSurfacePlot();
00282     void remove3DMatrixPlots(Matrix *m);
00283     void updateMatrixPlots(MdiSubWindow *);
00284     void add3DData();
00285     void change3DData();
00286     void change3DData(const QString& colName);
00287     void change3DMatrix();
00288     void change3DMatrix(const QString& matrix_name);
00289     void insertNew3DData(const QString& colName);
00290     void add3DMatrixPlot();
00291     void insert3DMatrixPlot(const QString& matrix_name);
00292     void initPlot3D(Graph3D *plot);
00293     void customPlot3D(Graph3D *plot);
00294     void setPlot3DOptions();
00295 
00296     void plot3DWireframe();
00297     void plot3DHiddenLine();
00298     void plot3DPolygons();
00299     void plot3DWireSurface();
00300 
00301     Graph3D* plot3DMatrix(Matrix *m = 0, int style = 5);
00302 
00303     void plot3DRibbon();
00304     void plot3DScatter();
00305     void plot3DTrajectory();
00306     void plot3DBars();
00308 
00310 
00311     MultiLayer * newFunctionPlot(QStringList &formulas, double start, double end, int points = 100, const QString& var = "x", int type = 0);
00312 
00313     FunctionDialog* functionDialog();
00314     FunctionDialog* showFunctionDialog();
00315     FunctionDialog* showFunctionDialog(Graph * g, int curve);
00316     void addFunctionCurve();
00317     void clearSurfaceFunctionsList();
00318     void clearLogInfo();
00319     void clearParamFunctionsList();
00320     void clearPolarFunctionsList();
00321     void updateFunctionLists(int type, QStringList &formulas);
00322     void updateSurfaceFuncList(const QString& s);
00324 
00326 
00327 
00328     Matrix* newMatrix(int rows = 32, int columns = 32);
00330     Matrix* newMatrix(const QString& caption, int r, int c);
00331     Matrix* matrix(const QString& name);
00332     Matrix* convertTableToMatrix();
00333     Matrix* tableToMatrix(Table* t);
00334     void initMatrix(Matrix* m, const QString& caption);
00335     void transposeMatrix();
00336     void invertMatrix();
00337     void matrixDeterminant();
00338     void flipMatrixVertically();
00339     void flipMatrixHorizontally();
00340     void rotateMatrix90();
00341     void rotateMatrixMinus90();
00342     void viewMatrixImage();
00343     void viewMatrixTable();
00344     void exportMatrix();
00345     void setMatrixGrayScale();
00346     void setMatrixRainbowScale();
00347     void viewMatrixColumnRow();
00348     void viewMatrixXY();
00349     void matrixDirectFFT();
00350     void matrixInverseFFT();
00352 
00354 
00355 
00356     Table* newTable();
00357 
00358     // getCurrent... functions for python interface
00359     Table* currentTable();
00360     MultiLayer* currentPlot();
00361     Note* currentNote();
00362     Matrix* currentMatrix();
00363 
00365     Table* newTable(const QString& caption,int r, int c);
00366     Table* newTable(int r, int c, const QString& name = QString(),const QString& legend = QString());
00367     Table* newTable(const QString& caption, int r, int c, const QString& text);
00377     Table* newHiddenTable(const QString& name, const QString& label, int r, int c, const QString& text=QString());
00378     Table* table(const QString& name);
00379     Table* convertMatrixToTableDirect();
00380     Table* convertMatrixToTableXYZ();
00381     Table* convertMatrixToTableYXZ();
00382     Table* matrixToTable(Matrix* m, MatrixToTableConversion conversionType = Direct);
00383     QList<MdiSubWindow *> tableList();
00385     bool hasTable();
00387     QStringList tableNames();
00388 
00389     void connectTable(Table* w);
00390     void initTable(Table* w, const QString& caption);
00391     void customTable(Table* w);
00392 
00393     void importASCII();
00394     void importASCII(const QStringList& files, int import_mode, const QString& local_column_separator, int local_ignored_lines, bool local_rename_columns,
00395         bool local_strip_spaces, bool local_simplify_spaces, bool local_import_comments,
00396         QLocale local_separators, const QString& local_comment_string, bool import_read_only, int endLineChar);
00397     void exportAllTables(const QString& sep, bool colNames, bool colComments, bool expSelection);
00398     void exportASCII(const QString& tableName, const QString& sep, bool colNames, bool colComments, bool expSelection);
00399 
00401     void recalculateTable();
00402 
00403     TableStatistics *newTableStatistics(Table *base, int type, QList<int>,
00404         const QString &caption=QString::null);
00406 
00408 
00409     void setPreferences(Graph* g);
00410     void setGraphDefaultSettings(bool autoscale,bool scaleFonts,bool resizeLayers,bool antialiasing);
00411     void setLegendDefaultSettings(int frame, const QFont& font,
00412                              const QColor& textCol, const QColor& backgroundCol);
00413     void setArrowDefaultSettings(double lineWidth,  const QColor& c, Qt::PenStyle style,
00414                                 int headLength, int headAngle, bool fillHead);
00415 
00416     void plotL();
00417     void plotP();
00418     void plotLP();
00419     void plotPie();
00420     void plotVerticalBars();
00421     void plotHorizontalBars();
00422     void plotArea();
00423     void plotVertSteps();
00424     void plotHorSteps();
00425     void plotSpline();
00426     void plotVerticalDropLines();
00427     MultiLayer* plotHistogram();
00428     MultiLayer* plotHistogram(Matrix *m);
00429     void plotVectXYXY();
00430     void plotVectXYAM();
00431     void plotBoxDiagram();
00432 
00434     bool validFor3DPlot(Table *table);
00436     bool validFor2DPlot(Table *table);
00438     MultiLayer* generate2DGraph(Graph::CurveType type);
00440 
00442 
00443     void intensityTable();
00444     void pixelLineProfile();
00445     void loadImage();
00446     void loadImage(const QString& fn);
00447     Matrix* importImage(const QString& = QString());
00449 
00451 
00452     void exportLayer();
00453     void exportGraph();
00454     void exportAllGraphs();
00455     void exportPDF();
00456     void print();
00457     void printAllPlots();
00459 
00460     QStringList columnsList(Table::PlotDesignation plotType = Table::All);
00461 
00462     void undo();
00463     void redo();
00464 
00466 
00467     MdiSubWindow* clone(MdiSubWindow* w = 0);
00468     void rename();
00469     void renameWindow();
00470 
00472     void renameWindow(Q3ListViewItem *item, int, const QString &s);
00473 
00475     bool setWindowName(MdiSubWindow *w, const QString &text);
00476 
00477     void maximizeWindow(Q3ListViewItem * lbi = 0);
00478     void maximizeWindow(MdiSubWindow *w);
00479     void minimizeWindow(MdiSubWindow *w = 0);
00481     void setWindowGeometry(int x, int y, int w, int h);
00482 
00483     void updateWindowStatus(MdiSubWindow* );
00484 
00485     bool hidden(QWidget* window);
00486     void closeActiveWindow();
00487     void closeWindow(MdiSubWindow* window);
00488 
00490     void removeWindowFromLists(MdiSubWindow* w);
00491 
00492     void hideWindow(MdiSubWindow* window);
00493     void hideWindow();
00494     void hideActiveWindow();
00495     void activateWindow();
00496     void activateWindow(MdiSubWindow *);
00498 
00500     static void about();
00502     static QString versionString();
00503     void removeCurves(const QString& name);
00504     QStringList dependingPlots(const QString& caption);
00505     QStringList depending3DPlots(Matrix *m);
00506     QStringList multilayerDependencies(QWidget *w);
00507 
00508     void saveAsTemplate(MdiSubWindow* w = 0, const QString& = QString());
00509     void openTemplate();
00510     MdiSubWindow* openTemplate(const QString& fn);
00511 
00512     QString windowGeometryInfo(MdiSubWindow *w);
00513     void restoreWindowGeometry(ApplicationWindow *app, MdiSubWindow *w, const QString s);
00514     void restoreApplicationGeometry();
00515     void resizeActiveWindow();
00516     void resizeWindow();
00517 
00519 
00520     void setListView(const QString& caption,const QString& view);
00521     void renameListViewItem(const QString& oldName,const QString& newName);
00522     void setListViewDate(const QString& caption,const QString& date);
00523     QString listViewDate(const QString& caption);
00524     void setListViewSize(const QString& caption,const QString& size);
00525     void setListViewLabel(const QString& caption,const QString& label);
00527 
00528     void updateColNames(const QString& oldName, const QString& newName);
00529     void updateTableNames(const QString& oldName, const QString& newName);
00530     void changeMatrixName(const QString& oldName, const QString& newName);
00531     void updateCurves(Table *t, const QString& name);
00532 
00533     void showTable(const QString& curve);
00534     void showTable(int i);
00535 
00536     void addColToTable();
00537     void cutSelection();
00538     void copySelection();
00539     void copyMarker();
00540     void pasteSelection();
00541     void clearSelection();
00542     void copyActiveLayer();
00543 
00544     void newProject();
00545 
00547 
00548     Matrix* openMatrix(ApplicationWindow* app, const QStringList &flist);
00549     Table* openTable(ApplicationWindow* app, const QStringList &flist);
00550     TableStatistics* openTableStatistics(const QStringList &flist);
00551     Graph3D* openSurfacePlot(ApplicationWindow* app, const QStringList &lst);
00552     Graph* openGraph(ApplicationWindow* app, MultiLayer *plot, const QStringList &list);
00553 
00554     void openRecentProject(int index);
00556 
00558 
00559     void sortSelection();
00560     void sortActiveTable();
00561     void normalizeSelection();
00562     void normalizeActiveTable();
00563     void correlate();
00564     void autoCorrelate();
00565     void convolute();
00566     void deconvolute();
00567     void clearTable();
00568     void goToRow();
00569     void goToColumn();
00571 
00573 
00574     void newLegend();
00575     void addTimeStamp();
00576     void drawLine();
00577     void drawArrow();
00578     void drawPoints();
00579     void addText();
00580     void disableAddText();
00581     void addImage();
00582     void zoomIn();
00583     void zoomOut();
00584     void setAutoScale();
00585     void showRangeSelectors();
00586     void showCursor();
00587     void showScreenReader();
00588     void pickPointerCursor();
00589     void disableTools();
00590     void pickDataTool( QAction* action );
00591 
00592     void updateLog(const QString& result);
00594 
00596 
00597     void deleteFitTables();
00598     void fitLinear();
00599     void fitSigmoidal();
00600     void fitGauss();
00601     void fitLorentz();
00602     void fitMultiPeak(int profile);
00603     void fitMultiPeakGauss();
00604     void fitMultiPeakLorentz();
00606 
00608 
00609     void integrate();
00610     void differentiate();
00611     void analysis(Analysis operation);
00612     void analyzeCurve(Graph *g, Analysis operation, const QString& curveTitle);
00613     void showDataSetDialog(Analysis operation);
00615 
00616     void addErrorBars();
00617     void defineErrorBars(const QString& name,int type,const QString& percent,int direction);
00618     void defineErrorBars(const QString& curveName,const QString& errColumnName, int direction);
00619     void movePoints();
00620     void removePoints();
00621 
00623 
00624     void closeEvent( QCloseEvent*);
00625     void timerEvent ( QTimerEvent *e);
00626     void dragEnterEvent( QDragEnterEvent* e );
00627     void dropEvent( QDropEvent* e );
00628     void customEvent( QEvent* e);
00630 
00632 
00633     void showFindDialogue();
00635     void showPlotDialog(int curveKey = -1);
00636     QDialog* showScaleDialog();
00637     QDialog* showPlot3dDialog();
00638     AxesDialog* showScalePageFromAxisDialog(int axisPos);
00639     AxesDialog* showAxisPageFromAxisDialog(int axisPos);
00640     void showAxisDialog();
00641     void showGridDialog();
00642     void showGeneralPlotDialog();
00643     void showResults(bool ok);
00644     void showResults(const QString& s, bool ok=true);
00645     void showTextDialog();
00646     void showLineDialog();
00647     void showTitleDialog();
00648     void showExportASCIIDialog();
00649     void showCurvesDialog();
00650     void showCurveRangeDialog();
00651     CurveRangeDialog* showCurveRangeDialog(Graph *g, int curve);
00652     AssociationsDialog* showPlotAssociations(int curve);
00653 
00654     void showAxisTitleDialog();
00655     void showColumnOptionsDialog();
00656     void showRowsDialog();
00657     void showDeleteRowsDialog();
00658     void showColsDialog();
00659     void showColMenu(int c);
00660     void showColumnValuesDialog();
00661 
00662     void showGraphContextMenu();
00663     void showTableContextMenu(bool selection);
00664     void showWindowContextMenu();
00665     void customWindowTitleBarMenu(MdiSubWindow *w, QMenu *menu);
00666     void showCurveContextMenu(QwtPlotCurve *);
00667     void showCurvePlotDialog();
00668     void showCurveWorksheet();
00669     void showCurveWorksheet(Graph *g, int curveIndex);
00670     void showWindowPopupMenu(Q3ListViewItem *it, const QPoint &p, int);
00671 
00673     void showListViewSelectionMenu(const QPoint &p);
00674 
00676     void showListViewPopupMenu(const QPoint &p);
00677 
00678     void showScriptWindow();
00679     void showMoreWindows();
00680     void showMarkerPopupMenu();
00681     void showHelp();
00682     static void showStandAloneHelp();
00683     void chooseHelpFolder();
00684     void showPlotWizard();
00685     void showFitPolynomDialog();
00686     void showIntegrationDialog();
00687     void showInterpolationDialog();
00688     void showExpGrowthDialog();
00689     void showExpDecayDialog();
00690     void showExpDecayDialog(int type);
00691     void showTwoExpDecayDialog();
00692     void showExpDecay3Dialog();
00693     void showRowStatistics();
00694     void showColStatistics();
00695     void showFitDialog();
00696     void showImageDialog();
00697     void showLayerDialog();
00698     void showPreferencesDialog();
00699     void showMatrixDialog();
00700     void showMatrixSizeDialog();
00701     void showMatrixValuesDialog();
00702     void showSmoothSavGolDialog();
00703     void showSmoothFFTDialog();
00704     void showSmoothAverageDialog();
00705     void showSmoothDialog(int m);
00706     void showFilterDialog(int filter);
00707     void lowPassFilterDialog();
00708     void highPassFilterDialog();
00709     void bandPassFilterDialog();
00710     void bandBlockFilterDialog();
00711     void showFFTDialog();
00712     void showColorMapDialog();
00714 
00715     void translateCurveHor();
00716     void translateCurveVert();
00717 
00719     void removeCurve();
00720     void hideCurve();
00721     void hideOtherCurves();
00722     void showAllCurves();
00723     void setCurveFullRange();
00724 
00725     void setAscValues();
00726     void setRandomValues();
00727     void setXCol();
00728     void setYCol();
00729     void setZCol();
00730     void setXErrCol();
00731     void setYErrCol();
00732     void setLabelCol();
00733     void disregardCol();
00734     void setReadOnlyCol();
00735     void setReadOnlyColumns();
00736     void setReadWriteColumns();
00737     void swapColumns();
00738     void moveColumnRight();
00739     void moveColumnLeft();
00740     void moveColumnFirst();
00741     void moveColumnLast();
00742 
00743     void updateConfirmOptions(bool askTables, bool askMatrixes, bool askPlots2D, bool askPlots3D, bool askNotes);
00744 
00746 
00747     void toggle3DAnimation(bool on = true);
00749     void togglePerspective(bool on = true);
00751     void resetRotation();
00753     void fitFrameToLayer();
00754     void setFramed3DPlot();
00755     void setBoxed3DPlot();
00756     void removeAxes3DPlot();
00757     void removeGrid3DPlot();
00758     void setHiddenLineGrid3DPlot();
00759     void setLineGrid3DPlot();
00760     void setPoints3DPlot();
00761     void setCrosses3DPlot();
00762     void setCones3DPlot();
00763     void setBars3DPlot();
00764     void setFilledMesh3DPlot();
00765     void setEmptyFloor3DPlot();
00766     void setFloorData3DPlot();
00767     void setFloorIso3DPlot();
00768     void setFloorGrid3DPlot(bool on);
00769     void setCeilGrid3DPlot(bool on);
00770     void setRightGrid3DPlot(bool on);
00771     void setLeftGrid3DPlot(bool on);
00772     void setFrontGrid3DPlot(bool on);
00773     void setBackGrid3DPlot(bool on);
00774     void pickPlotStyle( QAction* action );
00775     void pickCoordSystem( QAction* action);
00776     void pickFloorStyle( QAction* action);
00777     void custom3DActions(QMdiSubWindow *w);
00778     void custom3DGrids(int grids);
00780 
00781     void updateRecentProjectsList();
00782 
00784     void receivedVersionFile(bool error);
00786     void searchForUpdates();
00787 #ifdef QTIPLOT_SUPPORT
00788     void showDonationDialog();
00789 #endif
00791     void showSupportPage();
00793     void showDonationsPage();
00795     void showHomePage();
00797     void showForums();
00799     void showBugTracker();
00801     void downloadManual();
00803     void downloadTranslation();
00804 #ifdef QTIPLOT_DEMO
00806     void showDemoVersionMessage();
00807 #endif
00808 
00809     void parseCommandLineArguments(const QStringList& args);
00810     void createLanguagesList();
00811     void switchToLanguage(int param);
00812     void switchToLanguage(const QString& locale);
00813 
00814     bool alreadyUsedName(const QString& label);
00815     bool projectHas2DPlots();
00816 
00818     MdiSubWindow* window(const QString& name);
00819 
00821     QStringList matrixNames();
00822 
00824 
00825 
00826     Note* newNote(const QString& caption = QString());
00827     Note* openNote(ApplicationWindow* app, const QStringList &flist);
00828     void saveNoteAs();
00829     void showNoteLineNumbers(bool show = true);
00831 
00833 
00834 
00835     Folder* currentFolder(){return current_folder;};
00837     void addFolder();
00838     Folder* addFolder(QString name, Folder* parent = NULL);
00840     void deleteFolder();
00841 
00843     bool deleteFolder(Folder *f);
00844 
00846     void deleteSelectedItems();
00848     void hideSelectedWindows();
00850     void showSelectedWindows();
00851 
00853     void desactivateFolders();
00854 
00856     bool changeFolder(Folder *newFolder, bool force = false);
00857 
00859     void folderItemChanged(Q3ListViewItem *it);
00861     void folderItemDoubleClicked(Q3ListViewItem *it);
00862 
00864 
00870     void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, bool fromFolders);
00871 
00873     void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, int);
00874 
00876     void startRenameFolder();
00877 
00879     void startRenameFolder(Q3ListViewItem *item);
00880 
00882     void renameFolder(Q3ListViewItem *it, int col, const QString &text);
00883 
00885     void showAllFolderWindows();
00886 
00888     void hideAllFolderWindows();
00889 
00891     void hideFolderWindows(Folder *f);
00892 
00894     void folderProperties();
00895 
00897     void windowProperties();
00898 
00900     void projectProperties();
00901 
00903     void appendProject();
00905     Folder* appendProject(const QString& file_name, Folder* parentFolder = 0);
00906     void saveAsProject();
00907     void saveFolderAsProject(Folder *f);
00908     void saveFolder(Folder *folder, const QString& fn, bool compress = false);
00909 
00911     void addFolderListViewItem(Folder *f);
00912 
00914     void addListViewItem(MdiSubWindow *w);
00915 
00917     void setShowWindowsPolicy(int p);
00918 
00920     Folder* projectFolder();
00921 
00923     void find(const QString& s, bool windowNames, bool labels, bool folderNames,
00924               bool caseSensitive, bool partialMatch, bool subfolders);
00925 
00927     void dragFolderItems(QList<Q3ListViewItem *> items){draggedItems = items;};
00928 
00930     void dropFolderItems(Q3ListViewItem *dest);
00931 
00933 
00937     void moveFolder(FolderListItem *src, FolderListItem *dest);
00939 
00943     bool copyFolder(Folder *src, Folder *dest);
00944 
00945     void foldersMenuActivated( int id );
00947 
00949 
00950 
00951     void scriptError(const QString &message, const QString &scriptName, int lineNumber);
00953     void executeNotes();
00955     void showScriptingLangDialog();
00957     void restartScriptingEnv();
00959     void scriptPrint(const QString &text);
00961     bool setScriptingLanguage(const QString &lang, bool force=false);
00962 
00963     void scriptsDirPathChanged(const QString& path);
00965 
00966     void showToolBarsMenu();
00967 
00968 signals:
00969     void modified();
00970 
00971 private:
00972     void initCompleter();
00973     virtual QMenu * createPopupMenu(){return NULL;};
00974 
00975 private slots:
00977 
00978     void insertTranslatedStrings();
00979     void translateActionsStrings();
00980     void init(bool factorySettings = false);
00981     void initGlobalConstants();
00982     void createActions();
00983     void initMainMenu();
00984     void initToolBars();
00985     void initPlot3DToolBar();
00986     void disableActions();
00987     void customColumnActions();
00988     void disableToolbars();
00989     void customToolBars(QMdiSubWindow* w);
00990     void customMenu(QMdiSubWindow* w);
00991     void windowActivated(QMdiSubWindow *w);
00993 
00994     void analysisMenuAboutToShow();
00995     void fileMenuAboutToShow();
00996     void matrixMenuAboutToShow();
00997     void plotMenuAboutToShow();
00998     void plotDataMenuAboutToShow();
00999     void tableMenuAboutToShow();
01000     void windowsMenuAboutToShow();
01001     void windowsMenuActivated( int id );
01002 
01004 
01005     void enableTextEditor(Graph *g);
01006     void setFormatBarFont(const QFont &);
01007     void setFontSize(int);
01008     void setFontFamily(const QFont &);
01009     void setItalicFont(bool);
01010     void setBoldFont(bool);
01011     void insertSuperscript();
01012     void insertSubscript();
01013     void underline();
01014     void insertGreekSymbol();
01015     void insertGreekMajSymbol();
01016     void insertMathSymbol();
01018 
01019     void showCustomActionDialog();
01020     void performCustomAction(QAction *);
01021 
01022     void hideSelectedColumns();
01023     void showAllColumns();
01024 
01025 // TODO: a lot of this stuff should be private
01026 public:
01028     EndLineChar d_eol;
01030     bool d_in_place_editing;
01032     bool d_completion;
01034     bool d_note_line_numbers;
01035     QString d_python_config_folder;
01036     QString d_translations_folder;
01038     bool d_opening_file;
01039     QString customActionsDirPath;
01040     bool d_matrix_tool_bar, d_file_tool_bar, d_table_tool_bar, d_column_tool_bar, d_edit_tool_bar;
01041     bool d_plot_tool_bar, d_plot3D_tool_bar, d_display_tool_bar, d_format_tool_bar;
01042     bool d_backup_files;
01043     WindowType d_init_window_type;
01044     QRect d_script_win_rect, d_app_rect;
01045     bool d_script_win_on_top;
01046     bool d_inform_rename_table;
01047     QString d_export_col_separator;
01048     bool d_export_col_names, d_export_table_selection, d_export_col_comment;
01049 
01050     bool d_thousands_sep;
01052     QString d_image_export_filter;
01053     bool d_keep_plot_aspect;
01054     int d_export_vector_size;
01055     bool d_export_transparency;
01056     int d_export_quality;
01057     int d_export_resolution;
01058     bool d_export_color;
01060     QLocale d_ASCII_import_locale;
01062     EndLineChar d_ASCII_end_line;
01064     QString d_ASCII_file_filter, d_ASCII_comment_string;
01065     bool d_ASCII_import_comments, d_ASCII_import_read_only, d_ASCII_import_preview;
01066     int d_ASCII_import_mode, d_preview_lines;
01068     bool d_show_current_folder;
01069     bool d_scale_plots_on_print, d_print_cropmarks;
01070     bool d_show_table_comments;
01071     bool d_extended_plot_dialog;
01072     bool d_extended_import_ASCII_dialog;
01073     bool d_extended_export_dialog;
01074     bool d_extended_open_dialog;
01075     bool generateUniformFitPoints;
01076     bool generatePeakCurves;
01077     int peakCurvesColor;
01079     QSize d_add_curves_dialog_size;
01080 
01082     bool fit_scale_errors;
01083 
01085     int fitPoints;
01086 
01088     bool d_2_linear_fit_points;
01089 
01090     bool pasteFitResultsToPlot;
01091 
01093     bool writeFitResultsToLog;
01094 
01096     int fit_output_precision;
01097 
01099     int d_decimal_digits;
01100 
01102     Folder *current_folder;
01104     ShowWindowsPolicy show_windows_policy;
01105     enum {MaxRecentProjects = 10};
01107     int d_file_version;
01108 
01109     QColor workspaceColor, panelsColor, panelsTextColor;
01110     QColor d_graph_background_color, d_graph_canvas_color, d_graph_border_color;
01111     int d_graph_background_opacity, d_graph_canvas_opacity, d_graph_border_width;
01112     QString appStyle, workingDir;
01113 
01115     QString templatesDir;
01116     bool smooth3DMesh, autoScaleFonts, autoResizeLayers, autoSearchUpdates;
01117     bool confirmCloseTable, confirmCloseMatrix, confirmClosePlot2D, confirmClosePlot3D;
01118     bool confirmCloseFolder, confirmCloseNotes;
01119     bool titleOn, autoSave, drawBackbones, allAxesOn, autoscale2DPlots, antialiasing2DPlots;
01120     int majTicksStyle, minTicksStyle, legendFrameStyle, autoSaveTime, axesLineWidth, canvasFrameWidth;
01121     QColor legendBackground, legendTextColor, defaultArrowColor;
01122     int defaultArrowHeadLength, defaultArrowHeadAngle;
01123     double defaultArrowLineWidth, defaultCurveLineWidth;
01124     bool defaultArrowHeadFill;
01125     Qt::PenStyle defaultArrowLineStyle;
01126     int majTicksLength, minTicksLength, defaultPlotMargin;
01127     int defaultCurveStyle, defaultSymbolSize;
01128     QFont appFont, plot3DTitleFont, plot3DNumbersFont, plot3DAxesFont;
01129     QFont tableTextFont, tableHeaderFont, plotAxesFont, plotLegendFont, plotNumbersFont, plotTitleFont;
01130     QColor tableBkgdColor, tableTextColor, tableHeaderColor;
01131     QString projectname,columnSeparator, helpFilePath, appLanguage;
01132     QString configFilePath, fitPluginsPath, fitModelsPath, asciiDirPath, imagesDirPath, scriptsDirPath;
01133     int ignoredLines, savingTimerId, plot3DResolution, recentMenuID;
01134     bool renameColumns, strip_spaces, simplify_spaces;
01135     QStringList recentProjects;
01136     bool saved, showPlot3DProjection, showPlot3DLegend, orthogonal3DPlots, autoscale3DPlots;
01137     QStringList plot3DColors, locales;
01138     QStringList functions; //user-defined functions;
01139     QStringList xFunctions, yFunctions, rFunctions, thetaFunctions; // user functions for parametric and polar plots
01140     QStringList surfaceFunc; //user-defined surface functions;
01141     QStringList d_param_surface_func; //user-defined parametric surface functions;
01143     QStringList renamedTables;
01144 
01146 
01147     LegendWidget *d_text_copy;
01148     ArrowMarker *d_arrow_copy;
01149     ImageMarker *d_image_copy;
01151 
01153     bool autoSearchUpdatesRequest;
01154 
01156     QString defaultScriptingLang;
01157 
01158 private:
01159     MdiSubWindow *d_active_window;
01160     TextEditor *d_text_editor;
01161     QLocale d_locale;
01162     // Flag telling if table values should be automatically recalculated when values in a column are modified.
01163     bool d_auto_update_table_values;
01164     int d_matrix_undo_stack_size;
01165 
01167     int convertOldToNewColorIndex(int cindex);
01168 
01170     QList<Q3ListViewItem *> draggedItems;
01171 
01173     QHttp http;
01175     QBuffer version_buffer;
01176 
01177     Graph *lastCopiedLayer;
01178     QSplitter *explorerSplitter;
01179 
01180     QAssistantClient *assistant;
01181     ScriptWindow *scriptWindow;
01182     QTranslator *appTranslator, *qtTranslator;
01183     QDockWidget *explorerWindow, *undoStackWindow;
01184     QTextEdit *results;
01185 #ifdef SCRIPTING_CONSOLE
01186     QDockWidget *consoleWindow;
01187     QTextEdit *console;
01188 #endif
01189     QMdiArea *d_workspace;
01190 
01191     QToolBar *fileTools, *plotTools, *tableTools, *columnTools, *plot3DTools, *displayBar, *editTools, *plotMatrixBar;
01192     QToolBar *formatToolBar;
01193     QToolButton *btnResults;
01194     QWidgetList *hiddenWindows;
01195     QLineEdit *info;
01197     QCompleter *d_completer;
01198 
01199     QMenu *windowsMenu, *foldersMenu, *view, *graph, *fileMenu, *format, *edit, *recent;
01200     QMenu *help, *plot2DMenu, *analysisMenu, *multiPeakMenu;
01201     QMenu *matrixMenu, *plot3DMenu, *plotDataMenu, *tablesDepend, *scriptingMenu;
01202     QMenu *tableMenu, *fillMenu, *normMenu, *newMenu, *exportPlotMenu, *smoothMenu, *filterMenu, *decayMenu;
01203 
01204     QAction *actionEditCurveRange, *actionCurveFullRange, *actionShowAllCurves, *actionHideCurve, *actionHideOtherCurves;
01205     QAction *actionEditFunction, *actionRemoveCurve, *actionShowCurveWorksheet, *actionShowCurvePlotDialog;
01206     QAction *actionNewProject, *actionNewNote, *actionNewTable, *actionNewFunctionPlot;
01207     QAction *actionNewSurfacePlot, *actionNewMatrix, *actionNewGraph, *actionNewFolder;
01208     QAction *actionOpen, *actionLoadImage, *actionSaveProject, *actionSaveProjectAs, *actionImportImage;
01209     QAction *actionLoad, *actionUndo, *actionRedo;
01210     QAction *actionCopyWindow, *actionShowAllColumns, *actionHideSelectedColumns;
01211     QAction *actionCutSelection, *actionCopySelection, *actionPasteSelection, *actionClearSelection;
01212     QAction *actionShowExplorer, *actionShowLog, *actionAddLayer, *actionShowLayerDialog, *actionAutomaticLayout;
01213 #ifdef SCRIPTING_CONSOLE
01214     QAction *actionShowConsole;
01215 #endif
01216     QAction *actionSwapColumns, *actionMoveColRight, *actionMoveColLeft, *actionMoveColFirst, *actionMoveColLast;
01217     QAction *actionExportGraph, *actionExportAllGraphs, *actionPrint, *actionPrintAllPlots, *actionShowExportASCIIDialog;
01218     QAction *actionExportPDF, *actionReadOnlyCol;
01219     QAction *actionCloseAllWindows, *actionClearLogInfo, *actionShowPlotWizard, *actionShowConfigureDialog;
01220     QAction *actionShowCurvesDialog, *actionAddErrorBars, *actionAddFunctionCurve, *actionUnzoom, *actionNewLegend, *actionAddImage, *actionAddText;
01221     QAction *actionPlotL, *actionPlotP, *actionPlotLP, *actionPlotVerticalDropLines, *actionPlotSpline;
01222     QAction *actionPlotVertSteps, *actionPlotHorSteps, *actionPlotVerticalBars;
01223     QAction *actionPlotHorizontalBars, *actionPlotArea, *actionPlotPie, *actionPlotVectXYAM, *actionPlotVectXYXY;
01224     QAction *actionPlotHistogram, *actionPlotStackedHistograms, *actionPlot2VerticalLayers, *actionPlot2HorizontalLayers, *actionPlot4Layers, *actionPlotStackedLayers;
01225     QAction *actionPlot3DRibbon, *actionPlot3DBars, *actionPlot3DScatter, *actionPlot3DTrajectory;
01226     QAction *actionShowColStatistics, *actionShowRowStatistics, *actionShowIntDialog, *actionIntegrate;
01227     QAction *actionDifferentiate, *actionFitLinear, *actionShowFitPolynomDialog;
01228     QAction *actionShowExpDecayDialog, *actionShowTwoExpDecayDialog, *actionShowExpDecay3Dialog;
01229     QAction *actionFitExpGrowth, *actionFitSigmoidal, *actionFitGauss, *actionFitLorentz, *actionShowFitDialog;
01230     QAction *actionShowAxisDialog, *actionShowTitleDialog;
01231     QAction *actionShowColumnOptionsDialog, *actionShowColumnValuesDialog, *actionShowColsDialog, *actionShowRowsDialog;
01232     QAction *actionTableRecalculate;
01233     QAction *actionAbout, *actionShowHelp, *actionChooseHelpFolder;
01234     QAction *actionRename, *actionCloseWindow, *actionConvertTable;
01235     QAction *actionAddColToTable, *actionDeleteLayer, *actionInterpolate;
01236     QAction *actionResizeActiveWindow, *actionHideActiveWindow;
01237     QAction *actionShowMoreWindows, *actionPixelLineProfile, *actionIntensityTable;
01238     QAction *actionShowLineDialog, *actionShowImageDialog, *actionShowTextDialog;
01239     QAction *actionActivateWindow, *actionMinimizeWindow, *actionMaximizeWindow, *actionHideWindow, *actionResizeWindow;
01240     QAction *actionEditSurfacePlot, *actionAdd3DData;
01241     QAction *actionMatrixDeterminant, *actionSetMatrixProperties, *actionConvertMatrixXYZ, *actionConvertMatrixYXZ;
01242     QAction *actionSetMatrixDimensions, *actionConvertMatrixDirect, *actionSetMatrixValues, *actionTransposeMatrix, *actionInvertMatrix;
01243     QAction *actionPlot3DWireFrame, *actionPlot3DHiddenLine, *actionPlot3DPolygons, *actionPlot3DWireSurface;
01244     QAction *actionColorMap, *actionContourMap, *actionGrayMap;
01245     QAction *actionDeleteFitTables, *actionShowGridDialog, *actionTimeStamp;
01246     QAction *actionSmoothSavGol, *actionSmoothFFT, *actionSmoothAverage, *actionFFT;
01247     QAction *actionLowPassFilter, *actionHighPassFilter, *actionBandPassFilter, *actionBandBlockFilter;
01248     QAction *actionSortTable, *actionSortSelection, *actionNormalizeSelection;
01249     QAction *actionNormalizeTable, *actionConvolute, *actionDeconvolute, *actionCorrelate, *actionAutoCorrelate;
01250     QAction *actionTranslateHor, *actionTranslateVert, *actionSetAscValues, *actionSetRandomValues;
01251     QAction *actionSetXCol, *actionSetYCol, *actionSetZCol, *actionSetLabelCol, *actionDisregardCol, *actionSetXErrCol, *actionSetYErrCol;
01252     QAction *actionBoxPlot, *actionMultiPeakGauss, *actionMultiPeakLorentz, *actionCheckUpdates;
01253     QAction *actionDonate, *actionHomePage, *actionDownloadManual, *actionTechnicalSupport, *actionTranslations;
01254     QAction *actionHelpForums, *actionHelpBugReports;
01255     QAction *actionShowPlotDialog, *actionShowScaleDialog, *actionOpenTemplate, *actionSaveTemplate;
01256     QAction *actionNextWindow, *actionPrevWindow;
01257     QAction *actionScriptingLang, *actionRestartScripting, *actionClearTable, *actionGoToRow, *actionGoToColumn;
01258     QAction *actionNoteExecute, *actionNoteExecuteAll, *actionNoteEvaluate, *actionSaveNote;
01259     QAction *actionShowScriptWindow;
01260     QAction *actionAnimate, *actionPerspective, *actionFitFrame, *actionResetRotation;
01261     QAction *actionDeleteRows, *actionDrawPoints;
01262     QAction *btnCursor, *btnSelect, *btnPicker, *btnRemovePoints, *btnMovePoints;
01263     QAction *btnZoomIn, *btnZoomOut, *btnPointer, *btnLine, *btnArrow;
01264     QAction *actionFlipMatrixVertically, *actionFlipMatrixHorizontally, *actionRotateMatrix;
01265     QAction *actionViewMatrixImage, *actionViewMatrix, *actionExportMatrix;
01266     QAction *actionMatrixGrayScale, *actionMatrixRainbowScale, *actionMatrixCustomScale, *actionRotateMatrixMinus;
01267     QAction *actionMatrixXY, *actionMatrixColumnRow, *actionImagePlot, *actionToolBars;
01268     QAction *actionMatrixFFTDirect, *actionMatrixFFTInverse;
01269     QAction *actionFontBold, *actionFontItalic, *actionFontBox, *actionFontSize;
01270     QAction *actionSuperscript, *actionSubscript, *actionUnderline, *actionGreekSymbol, *actionCustomActionDialog;
01271     QAction *actionGreekMajSymbol, *actionMathSymbol;
01272     QAction *Box, *Frame, *None;
01273     QAction *front, *back, *right, *left, *ceil, *floor, *floordata, *flooriso, *floornone;
01274     QAction *wireframe, *hiddenline, *polygon, *filledmesh, *pointstyle, *barstyle, *conestyle, *crossHairStyle;
01275     QAction *actionShowUndoStack, *actionShowNoteLineNumbers;
01276     QActionGroup *coord, *floorstyle, *grids, *plotstyle, *dataTools;
01277     QList<QAction *> d_user_actions;
01278     QUndoView *d_undo_view;
01279 };
01280 #endif

Generated on Sun Jun 15 21:32:15 2008 for QtiPlot by  doxygen 1.5.6