00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
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
00043 #include "Table.h"
00044 #include "ScriptingEnv.h"
00045 #include "Script.h"
00046 #include "plot2D/TranslateCurveTool.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 TextEditor;
00087 class AssociationsDialog;
00088
00117 class ApplicationWindow: public QMainWindow, public scripted
00118 {
00119 Q_OBJECT
00120 public:
00121 ApplicationWindow(bool factorySettings = false);
00122 ApplicationWindow(const QStringList& l);
00123 ~ApplicationWindow();
00124
00125 enum ShowWindowsPolicy{HideAll, ActiveFolder, SubFolders};
00126 enum WindowType{NoWindow, TableWindow, MatrixWindow, MultiLayerWindow, NoteWindow, Plot3DWindow};
00127 enum MatrixToTableConversion{Direct, XYZ, YXZ};
00128 enum EndLineChar{LF, CRLF, CR};
00129 enum Analysis{NoAnalysis, Integrate, Diff, FitLinear, FitGauss, FitLorentz, FitSigmoidal};
00130
00131 FolderListView *lv, *folders;
00132 QDockWidget *logWindow;
00133
00138 QString generateUniqueName(const QString& name, bool increment = true);
00139 void saveFitFunctions(const QStringList& lst);
00140
00142
00143 void loadCustomActions();
00144 void reloadCustomActions();
00145 void removeCustomAction(QAction *);
00146 void addCustomAction(QAction *, const QString& parentName, int index = -1);
00147 QList<QAction *> customActionsList(){return d_user_actions;};
00148 QList<QMenu *> customizableMenusList();
00150
00151 QList<QMenu *> menusList();
00152 QList<QToolBar *> toolBarsList();
00153
00154 MdiSubWindow *activeWindow(WindowType type = NoWindow);
00155
00156 int matrixUndoStackSize(){return d_matrix_undo_stack_size;};
00157 void setMatrixUndoStackSize(int size);
00158
00159 QString endOfLine();
00160 bool autoUpdateTableValues(){return d_auto_update_table_values;};
00161 void setAutoUpdateTableValues(bool on = true);
00162
00163 QCompleter* completer(){return d_completer;};
00164 void enableCompletion(bool on = true);
00165
00166 QLocale clipboardLocale(){return d_clipboard_locale;};
00167 void setClipboardLocale(const QLocale& locale){d_clipboard_locale = locale;};
00168
00169 public slots:
00171
00172 void open();
00173 ApplicationWindow* open(const QString& fn, bool factorySettings = false, bool newProject = true);
00174 ApplicationWindow* openProject(const QString& fn, bool factorySettings = false, bool newProject = true);
00175 ApplicationWindow* importOPJ(const QString& fn, bool factorySettings = false, bool newProject = true);
00176
00184 ApplicationWindow * plotFile(const QString& fn);
00185
00192 ApplicationWindow * loadScript(const QString& fn, bool execute = false, bool factorySettings = false);
00193
00194 QList<MdiSubWindow *> windowsList();
00195 void updateWindowLists(MdiSubWindow *w);
00199 void cascade();
00200
00201 void saveProjectAs(const QString& fileName = QString(), bool compress = false);
00202 bool saveProject(bool compress = false);
00203
00205 void modifiedProject();
00207 void savedProject();
00209 void modifiedProject(MdiSubWindow *w);
00211
00213
00214 void readSettings();
00215 void saveSettings();
00216 void setSaveSettings(bool autoSaving, int min);
00217 void changeAppStyle(const QString& s);
00218 void changeAppFont(const QFont& f);
00219 void updateAppFonts();
00220 void setAppColors(const QColor& wc,const QColor& pc,const QColor& tpc, bool force = false);
00221
00222 void initWindow();
00224
00226
00227
00228 MultiLayer* newGraph(const QString& caption = tr("Graph"));
00229 MultiLayer* multilayerPlot(int c, int r, int style);
00230 MultiLayer* multilayerPlot(Table* w, const QStringList& colList, int style, int startRow = 0, int endRow = -1);
00232 MultiLayer* multilayerPlot(const QString& caption, int layers = 1, int rows = 1, int cols = 1);
00234 MultiLayer* multilayerPlot(const QStringList& colList);
00235 void connectMultilayerPlot(MultiLayer *g);
00236 void addLayer();
00237 void addInsetLayer(bool curves = false);
00238 void addInsetCurveLayer();
00239 void deleteLayer();
00240 void extractGraphs();
00241 void extractLayers();
00242
00244 MultiLayer* plotSpectrogram(Matrix *m, Graph::CurveType type);
00245 MultiLayer* plotGrayScale(Matrix *m = 0);
00246 MultiLayer* plotContour(Matrix *m = 0);
00247 MultiLayer* plotColorMap(Matrix *m = 0);
00248 MultiLayer* plotImage(Matrix *m = 0);
00249
00251 void autoArrangeLayers();
00252 void initMultilayerPlot(MultiLayer* g, const QString& name);
00253 void polishGraph(Graph *g, int style);
00254 void plot2VerticalLayers();
00255 void plot2HorizontalLayers();
00256 void plot4Layers();
00257 void plotStackedLayers();
00258 void plotStackedHistograms();
00260
00262
00263 Graph3D* newPlot3D();
00264 Graph3D* openMatrixPlot3D(const QString& caption, const QString& matrix_name,
00265 double xl,double xr,double yl,double yr,double zl,double zr);
00266 Graph3D* plotXYZ(Table* table,const QString& zColName, int type);
00267
00268 Graph3D* dataPlot3D(const QString& caption,const QString& formula,
00269 double xl, double xr, double yl, double yr, double zl, double zr);
00270 Graph3D* openPlotXYZ(const QString& caption,const QString& formula,
00271 double xl, double xr, double yl, double yr, double zl, double zr);
00273
00275
00276 Graph3D* plotSurface(const QString& formula, double xl, double xr,
00277 double yl, double yr, double zl, double zr, int columns = 40, int rows = 30);
00278 Graph3D* plotParametricSurface(const QString& xFormula, const QString& yFormula,
00279 const QString& zFormula, double ul, double ur, double vl, double vr,
00280 int columns, int rows, bool uPeriodic, bool vPeriodic);
00281
00282 void connectSurfacePlot(Graph3D *plot);
00283 void newSurfacePlot();
00284 void editSurfacePlot();
00285 void remove3DMatrixPlots(Matrix *m);
00286 void updateMatrixPlots(MdiSubWindow *);
00287 void add3DData();
00288 void change3DData();
00289 void change3DData(const QString& colName);
00290 void change3DMatrix();
00291 void change3DMatrix(const QString& matrix_name);
00292 void insertNew3DData(const QString& colName);
00293 void add3DMatrixPlot();
00294 void insert3DMatrixPlot(const QString& matrix_name);
00295 void initPlot3D(Graph3D *plot);
00296 void customPlot3D(Graph3D *plot);
00297 void setPlot3DOptions();
00298
00299 void plot3DWireframe();
00300 void plot3DHiddenLine();
00301 void plot3DPolygons();
00302 void plot3DWireSurface();
00303
00304 Graph3D* plot3DMatrix(Matrix *m = 0, int style = 5);
00305
00306 void plot3DRibbon();
00307 void plot3DScatter();
00308 void plot3DTrajectory();
00309 void plot3DBars();
00311
00313
00314 MultiLayer * newFunctionPlot(QStringList &formulas, double start, double end, int points = 100, const QString& var = "x", int type = 0);
00315
00316 FunctionDialog* functionDialog();
00317 FunctionDialog* showFunctionDialog();
00318 FunctionDialog* showFunctionDialog(Graph * g, int curve);
00319 void addFunctionCurve();
00320 void clearSurfaceFunctionsList();
00321 void clearLogInfo();
00322 void clearParamFunctionsList();
00323 void clearPolarFunctionsList();
00324 void updateFunctionLists(int type, QStringList &formulas);
00325 void updateSurfaceFuncList(const QString& s);
00327
00329
00330
00331 Matrix* newMatrix(int rows = 32, int columns = 32);
00333 Matrix* newMatrix(const QString& caption, int r, int c);
00334 Matrix* matrix(const QString& name);
00335 Matrix* convertTableToMatrix();
00336 Matrix* tableToMatrix(Table* t);
00337 void initMatrix(Matrix* m, const QString& caption);
00338 void transposeMatrix();
00339 void invertMatrix();
00340 void matrixDeterminant();
00341 void flipMatrixVertically();
00342 void flipMatrixHorizontally();
00343 void rotateMatrix90();
00344 void rotateMatrixMinus90();
00345 void viewMatrixImage();
00346 void viewMatrixTable();
00347 void exportMatrix(const QString& exportFilter = QString::null);
00348 void setMatrixGrayScale();
00349 void setMatrixRainbowScale();
00350 void viewMatrixColumnRow();
00351 void viewMatrixXY();
00352 void matrixDirectFFT();
00353 void matrixInverseFFT();
00355
00357
00358
00359 Table* newTable();
00360
00361
00362 Table* currentTable();
00363 MultiLayer* currentPlot();
00364 Note* currentNote();
00365 Matrix* currentMatrix();
00366
00368 Table* newTable(const QString& caption,int r, int c);
00369 Table* newTable(int r, int c, const QString& name = QString(),const QString& legend = QString());
00370 Table* newTable(const QString& caption, int r, int c, const QString& text);
00380 Table* newHiddenTable(const QString& name, const QString& label, int r, int c, const QString& text=QString());
00381 Table* table(const QString& name);
00382 Table* convertMatrixToTableDirect();
00383 Table* convertMatrixToTableXYZ();
00384 Table* convertMatrixToTableYXZ();
00385 Table* matrixToTable(Matrix* m, MatrixToTableConversion conversionType = Direct);
00386 QList<MdiSubWindow *> tableList();
00388 bool hasTable();
00390 QStringList tableNames();
00391
00392 void connectTable(Table* w);
00393 void initTable(Table* w, const QString& caption);
00394 void customTable(Table* w);
00395
00396 void importASCII();
00397 void importASCII(const QStringList& files, int import_mode, const QString& local_column_separator, int local_ignored_lines, bool local_rename_columns,
00398 bool local_strip_spaces, bool local_simplify_spaces, bool local_import_comments,
00399 QLocale local_separators, const QString& local_comment_string, bool import_read_only, int endLineChar);
00400 void exportAllTables(const QString& sep, bool colNames, bool colComments, bool expSelection);
00401 void exportASCII(const QString& tableName, const QString& sep, bool colNames, bool colComments, bool expSelection);
00402
00404 void recalculateTable();
00405
00406 TableStatistics *newTableStatistics(Table *base, int type, QList<int>,
00407 const QString &caption=QString::null);
00409
00411
00412 void setPreferences(Graph* g);
00413 void setGraphDefaultSettings(bool autoscale,bool scaleFonts,bool resizeLayers,bool antialiasing);
00414 void setArrowDefaultSettings(double lineWidth, const QColor& c, Qt::PenStyle style,
00415 int headLength, int headAngle, bool fillHead);
00416
00417 void plotL();
00418 void plotP();
00419 void plotLP();
00420 void plotPie();
00421 void plotVerticalBars();
00422 void plotHorizontalBars();
00423 void plotArea();
00424 void plotVertSteps();
00425 void plotHorSteps();
00426 void plotSpline();
00427 void plotVerticalDropLines();
00428 MultiLayer* plotHistogram();
00429 MultiLayer* plotHistogram(Matrix *m);
00430 void plotVectXYXY();
00431 void plotVectXYAM();
00432 void plotBoxDiagram();
00433 void plotDoubleYAxis();
00434 void zoomRectanglePlot();
00435
00437 bool validFor3DPlot(Table *table);
00439 bool validFor2DPlot(Table *table);
00441 MultiLayer* generate2DGraph(Graph::CurveType type);
00443
00445
00446 void intensityTable();
00447 void pixelLineProfile();
00448 void loadImage();
00449 void loadImage(const QString& fn);
00450 Matrix* importImage(const QString& = QString(), bool newWindow = false);
00452
00454
00455 void exportLayer();
00456 void exportGraph(const QString& exportFilter = QString::null);
00457 void exportAllGraphs();
00458 void exportPDF();
00459 void print();
00460 void printAllPlots();
00462
00463 QStringList columnsList(Table::PlotDesignation plotType = Table::All);
00464
00465 void undo();
00466 void redo();
00467
00469
00470 MdiSubWindow* clone(MdiSubWindow* w = 0);
00471 void rename();
00472 void renameWindow();
00473
00475 void renameWindow(Q3ListViewItem *item, int, const QString &s);
00476
00478 bool setWindowName(MdiSubWindow *w, const QString &text);
00479
00480 void maximizeWindow(Q3ListViewItem * lbi = 0);
00481 void maximizeWindow(MdiSubWindow *w);
00482 void minimizeWindow(MdiSubWindow *w = 0);
00483
00484 void updateWindowStatus(MdiSubWindow* );
00485
00486 bool hidden(QWidget* window);
00487 void closeActiveWindow();
00488 void closeWindow(MdiSubWindow* window);
00489
00491 void removeWindowFromLists(MdiSubWindow* w);
00492
00493 void hideWindow(MdiSubWindow* window);
00494 void hideWindow();
00495 void hideActiveWindow();
00496 void activateWindow();
00497 void activateWindow(MdiSubWindow *);
00499
00501 static void about();
00503 static QString versionString();
00504 void removeCurves(const QString& name);
00505 QStringList dependingPlots(const QString& caption);
00506 QStringList depending3DPlots(Matrix *m);
00507 QStringList multilayerDependencies(QWidget *w);
00508
00509 void saveAsTemplate(MdiSubWindow* w = 0, const QString& = QString());
00510 void openTemplate();
00511 MdiSubWindow* openTemplate(const QString& fn);
00512
00513 QString windowGeometryInfo(MdiSubWindow *w);
00514 void restoreWindowGeometry(ApplicationWindow *app, MdiSubWindow *w, const QString s);
00515 void restoreApplicationGeometry();
00516 void resizeActiveWindow();
00517 void resizeWindow();
00518
00520
00521 void setListView(const QString& caption,const QString& view);
00522 void renameListViewItem(const QString& oldName,const QString& newName);
00523 void setListViewDate(const QString& caption,const QString& date);
00524 QString listViewDate(const QString& caption);
00525 void setListViewSize(const QString& caption,const QString& size);
00526 void setListViewLabel(const QString& caption,const QString& label);
00528
00529 void updateColNames(const QString& oldName, const QString& newName);
00530 void updateTableNames(const QString& oldName, const QString& newName);
00531 void changeMatrixName(const QString& oldName, const QString& newName);
00532 void updateCurves(Table *t, const QString& name);
00533
00534 void showTable(const QString& curve);
00535 void showTable(int i);
00536
00537 void addColToTable();
00538 void cutSelection();
00539 void copySelection();
00540 void copyMarker();
00541 void pasteSelection();
00542 void clearSelection();
00543 void copyActiveLayer();
00544
00545 void newProject();
00546
00548
00549 Matrix* openMatrix(ApplicationWindow* app, const QStringList &flist);
00550 Table* openTable(ApplicationWindow* app, const QStringList &flist);
00551 TableStatistics* openTableStatistics(const QStringList &flist);
00552 Graph3D* openSurfacePlot(ApplicationWindow* app, const QStringList &lst);
00553 Graph* openGraph(ApplicationWindow* app, MultiLayer *plot, const QStringList &list);
00554
00555 void openRecentProject(int index);
00557
00559
00560 void sortSelection();
00561 void sortActiveTable();
00562 void normalizeSelection();
00563 void normalizeActiveTable();
00564 void correlate();
00565 void autoCorrelate();
00566 void convolute();
00567 void deconvolute();
00568 void clearTable();
00569 void goToRow();
00570 void goToColumn();
00572
00574
00575 void newLegend();
00576 void addTimeStamp();
00577 void drawLine();
00578 void drawArrow();
00579 void drawPoints();
00580 void addText();
00581 void addTexFormula();
00582 void addRectangle();
00583 void addImage();
00584 void zoomIn();
00585 void zoomOut();
00586 void setAutoScale();
00587 void showRangeSelectors();
00588 void showCursor();
00589 void showScreenReader();
00590 void pickPointerCursor();
00591 void disableTools();
00592 void pickDataTool( QAction* action );
00593
00594 void updateLog(const QString& result);
00596
00598
00599 void deleteFitTables();
00600 void fitLinear();
00601 void fitSigmoidal();
00602 void fitGauss();
00603 void fitLorentz();
00604 void fitMultiPeak(int profile);
00605 void fitMultiPeakGauss();
00606 void fitMultiPeakLorentz();
00608
00610
00611 void integrate();
00612 void differentiate();
00613 void analysis(Analysis operation);
00614 void analyzeCurve(Graph *g, Analysis operation, const QString& curveTitle);
00615 void showDataSetDialog(Analysis operation);
00617
00618 void addErrorBars();
00619 void defineErrorBars(const QString& name,int type,const QString& percent,int direction);
00620 void defineErrorBars(const QString& curveName,const QString& errColumnName, int direction);
00621 void movePoints();
00622 void removePoints();
00623
00625
00626 void closeEvent( QCloseEvent*);
00627 void timerEvent ( QTimerEvent *e);
00628 void dragEnterEvent( QDragEnterEvent* e );
00629 void dropEvent( QDropEvent* e );
00630 void customEvent( QEvent* e);
00632
00634
00635 void showFindDialogue();
00637 void showPlotDialog(int curveKey = -1);
00638 QDialog* showScaleDialog();
00639 QDialog* showPlot3dDialog();
00640 AxesDialog* showScalePageFromAxisDialog(int axisPos);
00641 AxesDialog* showAxisPageFromAxisDialog(int axisPos);
00642 void showAxisDialog();
00643 void showGridDialog();
00644 void showGeneralPlotDialog();
00645 void showResults(bool ok);
00646 void showResults(const QString& s, bool ok=true);
00647 void showEnrichementDialog();
00648 void showLineDialog();
00649 void showTitleDialog();
00650 void showExportASCIIDialog();
00651 void showCurvesDialog();
00652 void showCurveRangeDialog();
00653 CurveRangeDialog* showCurveRangeDialog(Graph *g, int curve);
00654 AssociationsDialog* showPlotAssociations(int curve);
00655
00656 void showAxisTitleDialog();
00657 void showColumnOptionsDialog();
00658 void showRowsDialog();
00659 void showDeleteRowsDialog();
00660 void showColsDialog();
00661 void showColMenu(int c);
00662 void showColumnValuesDialog();
00663
00664 void showGraphContextMenu();
00665 void showTableContextMenu(bool selection);
00666 void showWindowContextMenu();
00667 void customWindowTitleBarMenu(MdiSubWindow *w, QMenu *menu);
00668 void showCurveContextMenu(QwtPlotCurve *);
00669 void showCurvePlotDialog();
00670 void showCurveWorksheet();
00671 void showCurveWorksheet(Graph *g, int curveIndex);
00672 void showWindowPopupMenu(Q3ListViewItem *it, const QPoint &p, int);
00673
00675 void showListViewSelectionMenu(const QPoint &p);
00676
00678 void showListViewPopupMenu(const QPoint &p);
00679
00680 void showScriptWindow();
00681 void showMoreWindows();
00682 void showMarkerPopupMenu();
00683 void showHelp();
00684 static void showStandAloneHelp();
00685 void chooseHelpFolder();
00686 void showPlotWizard();
00687 void showFitPolynomDialog();
00688 void showFrequencyCountDialog();
00689 void showIntegrationDialog();
00690 void showInterpolationDialog();
00691 void showExpGrowthDialog();
00692 void showExpDecayDialog();
00693 void showExpDecayDialog(int type);
00694 void showTwoExpDecayDialog();
00695 void showExpDecay3Dialog();
00696 void showRowStatistics();
00697 void showColStatistics();
00698 void showFitDialog();
00699 void showLayerDialog();
00700 void showPreferencesDialog();
00701 void showMatrixDialog();
00702 void showMatrixSizeDialog();
00703 void showMatrixValuesDialog();
00704 void showSmoothSavGolDialog();
00705 void showSmoothFFTDialog();
00706 void showSmoothAverageDialog();
00707 void showSmoothDialog(int m);
00708 void showFilterDialog(int filter);
00709 void lowPassFilterDialog();
00710 void highPassFilterDialog();
00711 void bandPassFilterDialog();
00712 void bandBlockFilterDialog();
00713 void showFFTDialog();
00714 void showColorMapDialog();
00716
00717 void translateCurveHor();
00718 void translateCurve(TranslateCurveTool::Direction direction = TranslateCurveTool::Vertical);
00719
00721 void removeCurve();
00722 void hideCurve();
00723 void hideOtherCurves();
00724 void showAllCurves();
00725 void setCurveFullRange();
00726
00727 void setAscValues();
00728 void setRandomValues();
00729 void setXCol();
00730 void setYCol();
00731 void setZCol();
00732 void setXErrCol();
00733 void setYErrCol();
00734 void setLabelCol();
00735 void disregardCol();
00736 void setReadOnlyCol();
00737 void setReadOnlyColumns();
00738 void setReadWriteColumns();
00739 void swapColumns();
00740 void moveColumnRight();
00741 void moveColumnLeft();
00742 void moveColumnFirst();
00743 void moveColumnLast();
00744
00745 void updateConfirmOptions(bool askTables, bool askMatrixes, bool askPlots2D, bool askPlots3D, bool askNotes);
00746
00748
00749 void toggle3DAnimation(bool on = true);
00751 void togglePerspective(bool on = true);
00753 void resetRotation();
00755 void fitFrameToLayer();
00756 void setFramed3DPlot();
00757 void setBoxed3DPlot();
00758 void removeAxes3DPlot();
00759 void removeGrid3DPlot();
00760 void setHiddenLineGrid3DPlot();
00761 void setLineGrid3DPlot();
00762 void setPoints3DPlot();
00763 void setCrosses3DPlot();
00764 void setCones3DPlot();
00765 void setBars3DPlot();
00766 void setFilledMesh3DPlot();
00767 void setEmptyFloor3DPlot();
00768 void setFloorData3DPlot();
00769 void setFloorIso3DPlot();
00770 void setFloorGrid3DPlot(bool on);
00771 void setCeilGrid3DPlot(bool on);
00772 void setRightGrid3DPlot(bool on);
00773 void setLeftGrid3DPlot(bool on);
00774 void setFrontGrid3DPlot(bool on);
00775 void setBackGrid3DPlot(bool on);
00776 void pickPlotStyle( QAction* action );
00777 void pickCoordSystem( QAction* action);
00778 void pickFloorStyle( QAction* action);
00779 void custom3DActions(QMdiSubWindow *w);
00780 void custom3DGrids(int grids);
00782
00783 void updateRecentProjectsList();
00784
00786 void receivedVersionFile(bool error);
00788 void searchForUpdates();
00789 #ifdef QTIPLOT_SUPPORT
00790 void showDonationDialog();
00791 #endif
00793 void showSupportPage();
00795 void showDonationsPage();
00797 void showHomePage();
00799 void showForums();
00801 void showBugTracker();
00803 void downloadManual();
00805 void downloadTranslation();
00806 #ifdef QTIPLOT_DEMO
00808 void showDemoVersionMessage();
00809 #endif
00810
00811 void parseCommandLineArguments(const QStringList& args);
00812 void createLanguagesList();
00813 void switchToLanguage(int param);
00814 void switchToLanguage(const QString& locale);
00815
00816 bool alreadyUsedName(const QString& label);
00817 bool projectHas2DPlots();
00818
00820 MdiSubWindow* window(const QString& name);
00821
00823 QStringList matrixNames();
00824
00826
00827
00828 Note* newNote(const QString& caption = QString());
00829 Note* openNote(ApplicationWindow* app, const QStringList &flist);
00830 void saveNoteAs();
00831 void showNoteLineNumbers(bool show = true);
00833
00835
00836
00837 Folder* currentFolder(){return current_folder;};
00839 void addFolder();
00840 Folder* addFolder(QString name, Folder* parent = NULL);
00842 void deleteFolder();
00843
00845 bool deleteFolder(Folder *f);
00846
00848 void deleteSelectedItems();
00850 void hideSelectedWindows();
00852 void showSelectedWindows();
00853
00855 void desactivateFolders();
00856
00858 bool changeFolder(Folder *newFolder, bool force = false);
00859
00861 void folderItemChanged(Q3ListViewItem *it);
00863 void folderItemDoubleClicked(Q3ListViewItem *it);
00864
00866
00872 void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, bool fromFolders);
00873
00875 void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, int);
00876
00878 void startRenameFolder();
00879
00881 void startRenameFolder(Q3ListViewItem *item);
00882
00884 void renameFolder(Q3ListViewItem *it, int col, const QString &text);
00885
00887 void showAllFolderWindows();
00888
00890 void hideAllFolderWindows();
00891
00893 void hideFolderWindows(Folder *f);
00894
00896 void folderProperties();
00897
00899 void windowProperties();
00900
00902 void projectProperties();
00903
00905 void appendProject();
00907 Folder* appendProject(const QString& file_name, Folder* parentFolder = 0);
00908 void saveAsProject();
00909 void saveFolderAsProject(Folder *f);
00910 void saveFolder(Folder *folder, const QString& fn, bool compress = false);
00911
00913 void addFolderListViewItem(Folder *f);
00914
00916 void addListViewItem(MdiSubWindow *w);
00917
00919 void setShowWindowsPolicy(int p);
00920
00922 Folder* projectFolder();
00923
00925 void find(const QString& s, bool windowNames, bool labels, bool folderNames,
00926 bool caseSensitive, bool partialMatch, bool subfolders);
00927
00929 void dragFolderItems(QList<Q3ListViewItem *> items){draggedItems = items;};
00930
00932 void dropFolderItems(Q3ListViewItem *dest);
00933
00935
00939 void moveFolder(FolderListItem *src, FolderListItem *dest);
00941
00945 bool copyFolder(Folder *src, Folder *dest);
00946
00947 void foldersMenuActivated( int id );
00949
00951
00952
00953 void scriptError(const QString &message, const QString &scriptName, int lineNumber);
00955 void executeNotes();
00957 void showScriptingLangDialog();
00959 void restartScriptingEnv();
00961 void scriptPrint(const QString &text);
00963 bool setScriptingLanguage(const QString &lang, bool force=false);
00964
00965 void scriptsDirPathChanged(const QString& path);
00967
00968 void showToolBarsMenu();
00969
00970 signals:
00971 void modified();
00972
00973 private:
00974 void initCompleter();
00975 virtual QMenu * createPopupMenu(){return NULL;};
00976
00977 private slots:
00979
00980 void insertTranslatedStrings();
00981 void translateActionsStrings();
00982 void init(bool factorySettings = false);
00983 void initGlobalConstants();
00984 void createActions();
00985 void initMainMenu();
00986 void initToolBars();
00987 void initPlot3DToolBar();
00988 void disableActions();
00989 void customColumnActions();
00990 void disableToolbars();
00991 void customToolBars(QMdiSubWindow* w);
00992 void customMenu(QMdiSubWindow* w);
00993 void windowActivated(QMdiSubWindow *w);
00995
00996 void analysisMenuAboutToShow();
00997 void fileMenuAboutToShow();
00998 void matrixMenuAboutToShow();
00999 void plotMenuAboutToShow();
01000 void plotDataMenuAboutToShow();
01001 void tableMenuAboutToShow();
01002 void windowsMenuAboutToShow();
01003 void windowsMenuActivated( int id );
01004
01006
01007 void enableTextEditor(Graph *g);
01008 void setFormatBarFont(const QFont &);
01009 void setFontSize(int);
01010 void setFontFamily(const QFont &);
01011 void setItalicFont(bool);
01012 void setBoldFont(bool);
01013 void insertSuperscript();
01014 void insertSubscript();
01015 void underline();
01016 void insertGreekSymbol();
01017 void insertGreekMajSymbol();
01018 void insertMathSymbol();
01020
01021 void showCustomActionDialog();
01022 void performCustomAction(QAction *);
01023
01024 void hideSelectedColumns();
01025 void showAllColumns();
01026 void closedLastCopiedLayer(){lastCopiedLayer = NULL;};
01027
01028
01029 public:
01031 EndLineChar d_eol;
01033 bool d_in_place_editing;
01035 bool d_completion;
01037 bool d_note_line_numbers;
01038 QString d_python_config_folder;
01039 QString d_translations_folder;
01041 bool d_opening_file;
01042 QString customActionsDirPath;
01043 bool d_matrix_tool_bar, d_file_tool_bar, d_table_tool_bar, d_column_tool_bar, d_edit_tool_bar;
01044 bool d_plot_tool_bar, d_plot3D_tool_bar, d_display_tool_bar, d_format_tool_bar;
01045 bool d_backup_files;
01046 WindowType d_init_window_type;
01047 QRect d_script_win_rect, d_app_rect;
01048 bool d_script_win_on_top;
01049 bool d_inform_rename_table;
01050 QString d_export_col_separator;
01051 bool d_export_col_names, d_export_table_selection, d_export_col_comment;
01053 QString d_image_export_filter;
01054 bool d_export_transparency;
01055 int d_export_quality;
01056 int d_export_resolution;
01057 bool d_export_color;
01059 QLocale d_clipboard_locale;
01061 QLocale d_ASCII_import_locale;
01063 EndLineChar d_ASCII_end_line;
01065 QString d_ASCII_file_filter, d_ASCII_comment_string;
01066 bool d_ASCII_import_comments, d_ASCII_import_read_only, d_ASCII_import_preview;
01067 int d_ASCII_import_mode, d_preview_lines;
01069 bool d_show_current_folder;
01070 bool d_scale_plots_on_print, d_print_cropmarks;
01071 bool d_show_table_comments;
01072 bool d_extended_plot_dialog;
01073 bool d_extended_import_ASCII_dialog;
01074 bool d_extended_export_dialog;
01075 bool d_extended_open_dialog;
01076 bool generateUniformFitPoints;
01077 bool generatePeakCurves;
01078 int peakCurvesColor;
01080 QSize d_add_curves_dialog_size;
01081
01083 bool fit_scale_errors;
01084
01086 int fitPoints;
01087
01089 bool d_2_linear_fit_points;
01090
01091 bool pasteFitResultsToPlot;
01092
01094 bool writeFitResultsToLog;
01095
01097 int fit_output_precision;
01098
01100 int d_decimal_digits;
01101
01103 Folder *current_folder;
01105 ShowWindowsPolicy show_windows_policy;
01106 enum {MaxRecentProjects = 10};
01108 int d_file_version;
01109
01110 QColor d_rect_default_background;
01111 QBrush d_rect_default_brush;
01112 QColor workspaceColor, panelsColor, panelsTextColor;
01113 QColor d_graph_background_color, d_graph_canvas_color, d_graph_border_color, d_canvas_frame_color;
01114 int d_graph_background_opacity, d_graph_canvas_opacity, d_graph_border_width;
01115 QString appStyle, workingDir;
01116
01118 QString templatesDir;
01119 bool smooth3DMesh, autoScaleFonts, autoResizeLayers, autoSearchUpdates;
01120 bool confirmCloseTable, confirmCloseMatrix, confirmClosePlot2D, confirmClosePlot3D;
01121 bool confirmCloseFolder, confirmCloseNotes;
01122 bool titleOn, autoSave, drawBackbones, allAxesOn, autoscale2DPlots, antialiasing2DPlots;
01123 int majTicksStyle, minTicksStyle, legendFrameStyle, autoSaveTime, axesLineWidth, canvasFrameWidth;
01124 QColor legendBackground, legendTextColor, defaultArrowColor;
01125 int defaultArrowHeadLength, defaultArrowHeadAngle, d_legend_default_angle;
01126 double defaultArrowLineWidth, defaultCurveLineWidth;
01127 bool defaultArrowHeadFill;
01128 Qt::PenStyle defaultArrowLineStyle;
01129 QPen d_frame_widget_pen;
01130 int majTicksLength, minTicksLength, defaultPlotMargin;
01131 int defaultCurveStyle, defaultSymbolSize;
01132 QFont appFont, plot3DTitleFont, plot3DNumbersFont, plot3DAxesFont;
01133 QFont tableTextFont, tableHeaderFont, plotAxesFont, plotLegendFont, plotNumbersFont, plotTitleFont;
01134 QColor tableBkgdColor, tableTextColor, tableHeaderColor;
01135 QString projectname,columnSeparator, helpFilePath, appLanguage;
01136 QString configFilePath, fitPluginsPath, fitModelsPath, asciiDirPath, imagesDirPath, scriptsDirPath;
01137 int ignoredLines, savingTimerId, plot3DResolution, recentMenuID;
01138 bool renameColumns, strip_spaces, simplify_spaces;
01139 QStringList recentProjects;
01140 bool saved, showPlot3DProjection, showPlot3DLegend, orthogonal3DPlots, autoscale3DPlots;
01141 QStringList plot3DColors, locales;
01142 QStringList functions;
01143 QStringList xFunctions, yFunctions, rFunctions, thetaFunctions;
01144 QStringList surfaceFunc;
01145 QStringList d_param_surface_func;
01147 QStringList renamedTables;
01148
01150
01151 FrameWidget *d_enrichement_copy;
01152 ArrowMarker *d_arrow_copy;
01154
01156 bool autoSearchUpdatesRequest;
01157
01159 QString defaultScriptingLang;
01160
01161 private:
01162 MdiSubWindow *d_active_window;
01163 TextEditor *d_text_editor;
01164
01165 bool d_auto_update_table_values;
01166 int d_matrix_undo_stack_size;
01167
01169 int convertOldToNewColorIndex(int cindex);
01170
01172 QList<Q3ListViewItem *> draggedItems;
01173
01175 QHttp http;
01177 QBuffer version_buffer;
01178
01179 Graph *lastCopiedLayer;
01180 QSplitter *explorerSplitter;
01181
01182 QAssistantClient *assistant;
01183 ScriptWindow *scriptWindow;
01184 QTranslator *appTranslator, *qtTranslator;
01185 QDockWidget *explorerWindow, *undoStackWindow;
01186 QTextEdit *results;
01187 #ifdef SCRIPTING_CONSOLE
01188 QDockWidget *consoleWindow;
01189 QTextEdit *console;
01190 #endif
01191 QMdiArea *d_workspace;
01192
01193 QToolBar *fileTools, *plotTools, *tableTools, *columnTools, *plot3DTools, *displayBar, *editTools, *plotMatrixBar;
01194 QToolBar *formatToolBar;
01195 QToolButton *btnResults;
01196 QWidgetList *hiddenWindows;
01197 QLineEdit *info;
01199 QCompleter *d_completer;
01200
01201 QMenu *windowsMenu, *foldersMenu, *view, *graph, *fileMenu, *format, *edit, *recent;
01202 QMenu *help, *plot2DMenu, *analysisMenu, *multiPeakMenu;
01203 QMenu *matrixMenu, *plot3DMenu, *plotDataMenu, *tablesDepend, *scriptingMenu;
01204 QMenu *tableMenu, *fillMenu, *normMenu, *newMenu, *exportPlotMenu, *smoothMenu, *filterMenu, *decayMenu;
01205
01206 QAction *actionEditCurveRange, *actionCurveFullRange, *actionShowAllCurves, *actionHideCurve, *actionHideOtherCurves;
01207 QAction *actionEditFunction, *actionRemoveCurve, *actionShowCurveWorksheet, *actionShowCurvePlotDialog;
01208 QAction *actionNewProject, *actionNewNote, *actionNewTable, *actionNewFunctionPlot;
01209 QAction *actionNewSurfacePlot, *actionNewMatrix, *actionNewGraph, *actionNewFolder;
01210 QAction *actionOpen, *actionLoadImage, *actionSaveProject, *actionSaveProjectAs, *actionImportImage;
01211 QAction *actionLoad, *actionUndo, *actionRedo;
01212 QAction *actionCopyWindow, *actionShowAllColumns, *actionHideSelectedColumns;
01213 QAction *actionCutSelection, *actionCopySelection, *actionPasteSelection, *actionClearSelection;
01214 QAction *actionShowExplorer, *actionShowLog, *actionAddLayer, *actionShowLayerDialog, *actionAutomaticLayout;
01215 #ifdef SCRIPTING_CONSOLE
01216 QAction *actionShowConsole;
01217 #endif
01218 QAction *actionSwapColumns, *actionMoveColRight, *actionMoveColLeft, *actionMoveColFirst, *actionMoveColLast;
01219 QAction *actionExportGraph, *actionExportAllGraphs, *actionPrint, *actionPrintAllPlots, *actionShowExportASCIIDialog;
01220 QAction *actionExportPDF, *actionReadOnlyCol;
01221 QAction *actionCloseAllWindows, *actionClearLogInfo, *actionShowPlotWizard, *actionShowConfigureDialog;
01222 QAction *actionShowCurvesDialog, *actionAddErrorBars, *actionAddFunctionCurve, *actionUnzoom, *actionNewLegend, *actionAddImage, *actionAddText;
01223 QAction *actionPlotL, *actionPlotP, *actionPlotLP, *actionPlotVerticalDropLines, *actionPlotSpline;
01224 QAction *actionPlotVertSteps, *actionPlotHorSteps, *actionPlotVerticalBars;
01225 QAction *actionPlotHorizontalBars, *actionPlotArea, *actionPlotPie, *actionPlotVectXYAM, *actionPlotVectXYXY;
01226 QAction *actionPlotHistogram, *actionPlotStackedHistograms, *actionPlot2VerticalLayers, *actionPlot2HorizontalLayers, *actionPlot4Layers, *actionPlotStackedLayers;
01227 QAction *actionPlot3DRibbon, *actionPlot3DBars, *actionPlot3DScatter, *actionPlot3DTrajectory;
01228 QAction *actionPlotDoubleYAxis, *actionAddInsetLayer, *actionAddInsetCurveLayer;
01229 QAction *actionShowColStatistics, *actionShowRowStatistics, *actionShowIntDialog, *actionIntegrate;
01230 QAction *actionDifferentiate, *actionFitLinear, *actionShowFitPolynomDialog;
01231 QAction *actionShowExpDecayDialog, *actionShowTwoExpDecayDialog, *actionShowExpDecay3Dialog;
01232 QAction *actionFitExpGrowth, *actionFitSigmoidal, *actionFitGauss, *actionFitLorentz, *actionShowFitDialog;
01233 QAction *actionShowAxisDialog, *actionShowTitleDialog;
01234 QAction *actionShowColumnOptionsDialog, *actionShowColumnValuesDialog, *actionShowColsDialog, *actionShowRowsDialog;
01235 QAction *actionTableRecalculate, *actionExtractGraphs, *actionExtractLayers;
01236 QAction *actionAbout, *actionShowHelp, *actionChooseHelpFolder;
01237 QAction *actionRename, *actionCloseWindow, *actionConvertTable;
01238 QAction *actionAddColToTable, *actionDeleteLayer, *actionInterpolate;
01239 QAction *actionResizeActiveWindow, *actionHideActiveWindow;
01240 QAction *actionShowMoreWindows, *actionPixelLineProfile, *actionIntensityTable;
01241 QAction *actionShowLineDialog, *actionShowTextDialog;
01242 QAction *actionActivateWindow, *actionMinimizeWindow, *actionMaximizeWindow, *actionHideWindow, *actionResizeWindow;
01243 QAction *actionEditSurfacePlot, *actionAdd3DData;
01244 QAction *actionMatrixDeterminant, *actionSetMatrixProperties, *actionConvertMatrixXYZ, *actionConvertMatrixYXZ;
01245 QAction *actionSetMatrixDimensions, *actionConvertMatrixDirect, *actionSetMatrixValues, *actionTransposeMatrix, *actionInvertMatrix;
01246 QAction *actionPlot3DWireFrame, *actionPlot3DHiddenLine, *actionPlot3DPolygons, *actionPlot3DWireSurface;
01247 QAction *actionColorMap, *actionContourMap, *actionGrayMap;
01248 QAction *actionDeleteFitTables, *actionShowGridDialog, *actionTimeStamp;
01249 QAction *actionSmoothSavGol, *actionSmoothFFT, *actionSmoothAverage, *actionFFT;
01250 QAction *actionLowPassFilter, *actionHighPassFilter, *actionBandPassFilter, *actionBandBlockFilter;
01251 QAction *actionSortTable, *actionSortSelection, *actionNormalizeSelection;
01252 QAction *actionNormalizeTable, *actionConvolute, *actionDeconvolute, *actionCorrelate, *actionAutoCorrelate;
01253 QAction *actionTranslateHor, *actionTranslateVert, *actionSetAscValues, *actionSetRandomValues;
01254 QAction *actionSetXCol, *actionSetYCol, *actionSetZCol, *actionSetLabelCol, *actionDisregardCol, *actionSetXErrCol, *actionSetYErrCol;
01255 QAction *actionBoxPlot, *actionMultiPeakGauss, *actionMultiPeakLorentz, *actionCheckUpdates;
01256 QAction *actionDonate, *actionHomePage, *actionDownloadManual, *actionTechnicalSupport, *actionTranslations;
01257 QAction *actionHelpForums, *actionHelpBugReports;
01258 QAction *actionShowPlotDialog, *actionShowScaleDialog, *actionOpenTemplate, *actionSaveTemplate;
01259 QAction *actionNextWindow, *actionPrevWindow;
01260 QAction *actionScriptingLang, *actionRestartScripting, *actionClearTable, *actionGoToRow, *actionGoToColumn;
01261 QAction *actionNoteExecute, *actionNoteExecuteAll, *actionNoteEvaluate, *actionSaveNote;
01262 QAction *actionShowScriptWindow, *actionFrequencyCount;
01263 QAction *actionAnimate, *actionPerspective, *actionFitFrame, *actionResetRotation;
01264 QAction *actionDeleteRows, *actionDrawPoints, *actionAddZoomPlot;
01265 QAction *btnCursor, *btnSelect, *btnPicker, *btnRemovePoints, *btnMovePoints;
01266 QAction *btnZoomIn, *btnZoomOut, *btnPointer, *btnLine, *btnArrow;
01267 QAction *actionFlipMatrixVertically, *actionFlipMatrixHorizontally, *actionRotateMatrix;
01268 QAction *actionViewMatrixImage, *actionViewMatrix, *actionExportMatrix;
01269 QAction *actionMatrixGrayScale, *actionMatrixRainbowScale, *actionMatrixCustomScale, *actionRotateMatrixMinus;
01270 QAction *actionMatrixXY, *actionMatrixColumnRow, *actionImagePlot, *actionToolBars;
01271 QAction *actionMatrixFFTDirect, *actionMatrixFFTInverse;
01272 QAction *actionFontBold, *actionFontItalic, *actionFontBox, *actionFontSize;
01273 QAction *actionSuperscript, *actionSubscript, *actionUnderline, *actionGreekSymbol, *actionCustomActionDialog;
01274 QAction *actionGreekMajSymbol, *actionMathSymbol;
01275 QAction *Box, *Frame, *None;
01276 QAction *front, *back, *right, *left, *ceil, *floor, *floordata, *flooriso, *floornone;
01277 QAction *wireframe, *hiddenline, *polygon, *filledmesh, *pointstyle, *barstyle, *conestyle, *crossHairStyle;
01278 QAction *actionShowUndoStack, *actionShowNoteLineNumbers, *actionAddFormula, *actionAddRectangle;
01279 QActionGroup *coord, *floorstyle, *grids, *plotstyle, *dataTools;
01280 QList<QAction *> d_user_actions;
01281 QUndoView *d_undo_view;
01282 };
01283 #endif