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 <Q3Header>
00038 #include <QHttp>
00039 #include <QFile>
00040 #include <QSplitter>
00041 #include <QDesktopServices>
00042 #include <QBuffer>
00043 #include <QLocale>
00044
00045 #include "Table.h"
00046 #include "ScriptingEnv.h"
00047 #include "Script.h"
00048
00049 class QPixmap;
00050 class QCloseEvent;
00051 class QDropEvent;
00052 class QTimerEvent;
00053 class QDragEnterEvent;
00054 class QTranslator;
00055 class QDockWidget;
00056 class QAction;
00057 class QActionGroup;
00058 class QWorkspace;
00059 class QLineEdit;
00060 class QTranslator;
00061 class QToolButton;
00062 class QShortcut;
00063 class QMenu;
00064 class QToolBar;
00065 class QAssistantClient;
00066 class QLocale;
00067
00068 class Matrix;
00069 class Table;
00070 class Graph;
00071 class ScalePicker;
00072 class Graph3D;
00073 class Note;
00074 class MultiLayer;
00075 class FunctionDialog;
00076 class Folder;
00077 class FolderListItem;
00078 class FolderListView;
00079 class ScriptWindow;
00080 class Plot3DDialog;
00081 class MyWidget;
00082 class TableStatistics;
00083 class CurveRangeDialog;
00084 class LegendWidget;
00085 class ArrowMarker;
00086 class ImageMarker;
00087 class TextEditor;
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};
00127
00128 FolderListView *lv, *folders;
00129 QDockWidget *logWindow;
00130
00135 QString generateUniqueName(const QString& name, bool increment = true);
00136 void saveFitFunctions(const QStringList& lst);
00137
00139
00140 void loadCustomActions();
00141 void reloadCustomActions();
00142 void removeCustomAction(QAction *);
00143 void addCustomAction(QAction *, const QString& parentName);
00144 QList<QAction *> customActionsList(){return d_user_actions;};
00145 QList<QMenu *> customizableMenusList();
00147
00148 QList<QMenu *> menusList();
00149 QList<QToolBar *> toolBarsList();
00150
00151 public slots:
00153
00154 void open();
00155 ApplicationWindow* open(const QString& fn, bool factorySettings = false);
00156 ApplicationWindow* openProject(const QString& fn, bool factorySettings = false);
00157 ApplicationWindow* importOPJ(const QString& filename);
00158
00166 ApplicationWindow * plotFile(const QString& fn);
00167
00174 ApplicationWindow * loadScript(const QString& fn, bool execute = false, bool factorySettings = false);
00175
00176 QWidgetList * windowsList();
00177 void updateWindowLists(MyWidget *w);
00181 void cascade();
00182
00183 void saveProjectAs(const QString& fileName = QString(), bool compress = false);
00184 bool saveProject(bool compress = false);
00185
00187 void modifiedProject();
00189 void savedProject();
00191 void modifiedProject(QWidget *w);
00193
00195
00196 void readSettings();
00197 void saveSettings();
00198 void applyUserSettings();
00199 void setSaveSettings(bool autoSaving, int min);
00200 void changeAppStyle(const QString& s);
00201 void changeAppFont(const QFont& f);
00202 void updateAppFonts();
00203 void setAppColors(const QColor& wc,const QColor& pc,const QColor& tpc);
00204
00205 QLocale locale(){return d_locale;};
00206 void setLocale(const QLocale& l){d_locale = l;};
00207
00208 void initWindow();
00210
00212
00213 MultiLayer* multilayerPlot(int c, int r, int style);
00214 MultiLayer* multilayerPlot(Table* w, const QStringList& colList, int style, int startRow = 0, int endRow = -1);
00216 MultiLayer* multilayerPlot(const QString& caption);
00218 MultiLayer* multilayerPlot(const QStringList& colList);
00219 void connectMultilayerPlot(MultiLayer *g);
00220 void addLayer();
00221 void deleteLayer();
00222
00224 MultiLayer* plotSpectrogram(Matrix *m, Graph::CurveType type);
00225 MultiLayer* plotGrayScale(Matrix *m = 0);
00226 MultiLayer* plotContour(Matrix *m = 0);
00227 MultiLayer* plotColorMap(Matrix *m = 0);
00228 MultiLayer* plotImage(Matrix *m = 0);
00229
00231 void autoArrangeLayers();
00232 void initMultilayerPlot(MultiLayer* g, const QString& name);
00233 void polishGraph(Graph *g, int style);
00234 void plot2VerticalLayers();
00235 void plot2HorizontalLayers();
00236 void plot4Layers();
00237 void plotStackedLayers();
00238 void plotStackedHistograms();
00240
00242
00243 Graph3D* newPlot3D();
00244 Graph3D* openMatrixPlot3D(const QString& caption, const QString& matrix_name,
00245 double xl,double xr,double yl,double yr,double zl,double zr);
00246 Graph3D* plotXYZ(Table* table,const QString& zColName, int type);
00247
00248 Graph3D* dataPlot3D(const QString& caption,const QString& formula,
00249 double xl, double xr, double yl, double yr, double zl, double zr);
00250 Graph3D* openPlotXYZ(const QString& caption,const QString& formula,
00251 double xl, double xr, double yl, double yr, double zl, double zr);
00253
00255
00256 Graph3D* plotSurface(const QString& formula, double xl, double xr,
00257 double yl, double yr, double zl, double zr, int columns = 40, int rows = 30);
00258 Graph3D* plotParametricSurface(const QString& xFormula, const QString& yFormula,
00259 const QString& zFormula, double ul, double ur, double vl, double vr,
00260 int columns, int rows, bool uPeriodic, bool vPeriodic);
00261
00262 void connectSurfacePlot(Graph3D *plot);
00263 void newSurfacePlot();
00264 void editSurfacePlot();
00265 void remove3DMatrixPlots(Matrix *m);
00266 void updateMatrixPlots(QWidget *);
00267 void add3DData();
00268 void change3DData();
00269 void change3DData(const QString& colName);
00270 void change3DMatrix();
00271 void change3DMatrix(const QString& matrix_name);
00272 void insertNew3DData(const QString& colName);
00273 void add3DMatrixPlot();
00274 void insert3DMatrixPlot(const QString& matrix_name);
00275 void initPlot3D(Graph3D *plot);
00276 void customPlot3D(Graph3D *plot);
00277 void setPlot3DOptions();
00278
00279 void plot3DWireframe();
00280 void plot3DHiddenLine();
00281 void plot3DPolygons();
00282 void plot3DWireSurface();
00283
00284 Graph3D* plot3DMatrix(Matrix *m = 0, int style = 5);
00285
00286 void plot3DRibbon();
00287 void plot3DScatter();
00288 void plot3DTrajectory();
00289 void plot3DBars();
00291
00293
00294 MultiLayer * newFunctionPlot(QStringList &formulas, double start, double end, int points = 100, const QString& var = "x", int type = 0);
00295
00296 FunctionDialog* functionDialog();
00297 void showFunctionDialog();
00298 void showFunctionDialog(Graph * g, int curve);
00299 void addFunctionCurve();
00300 void clearSurfaceFunctionsList();
00301 void clearLogInfo();
00302 void clearParamFunctionsList();
00303 void clearPolarFunctionsList();
00304 void updateFunctionLists(int type, QStringList &formulas);
00305 void updateSurfaceFuncList(const QString& s);
00307
00309
00310
00311 Matrix* newMatrix(int rows = 32, int columns = 32);
00313 Matrix* newMatrix(const QString& caption, int r, int c);
00314 Matrix* matrix(const QString& name);
00315 Matrix* convertTableToMatrix();
00316 Matrix* tableToMatrix(Table* t);
00317 void initMatrix(Matrix* m, const QString& caption);
00318 void transposeMatrix();
00319 void invertMatrix();
00320 void matrixDeterminant();
00321 void flipMatrixVertically();
00322 void flipMatrixHorizontally();
00323 void rotateMatrix90();
00324 void rotateMatrixMinus90();
00325 void viewMatrixImage();
00326 void viewMatrixTable();
00327 void exportMatrix();
00328 void setMatrixGrayScale();
00329 void setMatrixRainbowScale();
00330 void viewMatrixColumnRow();
00331 void viewMatrixXY();
00332 void matrixDirectFFT();
00333 void matrixInverseFFT();
00335
00337
00338
00339 Table* newTable();
00341 Table* newTable(const QString& fname, const QString &sep, int lines, bool renameCols, bool stripSpaces,
00342 bool simplifySpaces, bool importComments, const QString &commentString, bool readOnly);
00344 Table* newTable(const QString& caption,int r, int c);
00345 Table* newTable(int r, int c, const QString& name = QString(),const QString& legend = QString());
00346 Table* newTable(const QString& caption, int r, int c, const QString& text);
00356 Table* newHiddenTable(const QString& name, const QString& label, int r, int c, const QString& text=QString());
00357 Table* table(const QString& name);
00358 Table* convertMatrixToTable();
00359 Table* matrixToTable(Matrix* m);
00360 QWidgetList* tableList();
00361
00362 void connectTable(Table* w);
00363 void initTable(Table* w, const QString& caption);
00364 void customTable(Table* w);
00365 void customizeTables(const QColor& bgColor,const QColor& textColor,
00366 const QColor& headerColor,const QFont& textFont,
00367 const QFont& headerFont, bool showComments);
00368
00369 void importASCII();
00370 void importASCII(const QStringList& files, int import_mode, const QString& local_column_separator, int local_ignored_lines, bool local_rename_columns,
00371 bool local_strip_spaces, bool local_simplify_spaces, bool local_import_comments, bool update_dec_separators,
00372 QLocale local_separators, const QString& local_comment_string, bool import_read_only);
00373 void exportAllTables(const QString& sep, bool colNames, bool colComments, bool expSelection);
00374 void exportASCII(const QString& tableName, const QString& sep, bool colNames, bool colComments, bool expSelection);
00375
00377 void recalculateTable();
00378
00379 TableStatistics *newTableStatistics(Table *base, int type, QList<int>,
00380 const QString &caption=QString::null);
00382
00384
00385 void setPreferences(Graph* g);
00386 void setGraphDefaultSettings(bool autoscale,bool scaleFonts,bool resizeLayers,bool antialiasing);
00387 void setLegendDefaultSettings(int frame, const QFont& font,
00388 const QColor& textCol, const QColor& backgroundCol);
00389 void setArrowDefaultSettings(int lineWidth, const QColor& c, Qt::PenStyle style,
00390 int headLength, int headAngle, bool fillHead);
00391
00392 void plotL();
00393 void plotP();
00394 void plotLP();
00395 void plotPie();
00396 void plotVerticalBars();
00397 void plotHorizontalBars();
00398 void plotArea();
00399 void plotVertSteps();
00400 void plotHorSteps();
00401 void plotSpline();
00402 void plotVerticalDropLines();
00403 MultiLayer* plotHistogram();
00404 MultiLayer* plotHistogram(Matrix *m);
00405 void plotVectXYXY();
00406 void plotVectXYAM();
00407 void plotBoxDiagram();
00408
00410 bool validFor3DPlot(Table *table);
00412 bool validFor2DPlot(Table *table);
00414 MultiLayer* generate2DGraph(Graph::CurveType type);
00416
00418
00419 void intensityTable();
00420 void pixelLineProfile();
00421 void loadImage();
00422 void loadImage(const QString& fn);
00423 Matrix* importImage(const QString& = QString());
00425
00427
00428 void exportLayer();
00429 void exportGraph();
00430 void exportAllGraphs();
00431 void exportPDF();
00432 void print();
00433 void print(QWidget* w);
00434 void printAllPlots();
00436
00437 QStringList columnsList(Table::PlotDesignation plotType = Table::All);
00438
00439 void undo();
00440 void redo();
00441
00443
00444 MyWidget* clone(MyWidget* w = 0);
00445 void rename();
00446 void renameWindow();
00447
00449 void renameWindow(Q3ListViewItem *item, int, const QString &s);
00450
00452 bool setWindowName(MyWidget *w, const QString &text);
00453
00454 void maximizeWindow(Q3ListViewItem * lbi);
00455 void maximizeWindow(MyWidget *w);
00456 void maximizeWindow();
00457 void minimizeWindow(MyWidget *w);
00458 void minimizeWindow();
00460 void setWindowGeometry(int x, int y, int w, int h);
00461
00462 void updateWindowStatus(MyWidget* );
00463
00464 bool hidden(QWidget* window);
00465 void closeActiveWindow();
00466 void closeWindow(MyWidget* window);
00467
00469 void removeWindowFromLists(MyWidget* w);
00470
00471 void hideWindow(MyWidget* window);
00472 void hideWindow();
00473 void hideActiveWindow();
00474 void activateWindow();
00475 void activateWindow(MyWidget *);
00476 void printWindow();
00478
00480 static void about();
00482 static QString versionString();
00483 void removeCurves(const QString& name);
00484 QStringList dependingPlots(const QString& caption);
00485 QStringList depending3DPlots(Matrix *m);
00486 QStringList multilayerDependencies(QWidget *w);
00487
00488 void saveAsTemplate(MyWidget* w = 0, const QString& = QString());
00489 void openTemplate();
00490 MyWidget* openTemplate(const QString& fn);
00491
00492 QString windowGeometryInfo(MyWidget *w);
00493 void restoreWindowGeometry(ApplicationWindow *app, MyWidget *w, const QString s);
00494 void restoreApplicationGeometry();
00495 void resizeActiveWindow();
00496 void resizeWindow();
00497
00499
00500 void setListView(const QString& caption,const QString& view);
00501 void renameListViewItem(const QString& oldName,const QString& newName);
00502 void setListViewDate(const QString& caption,const QString& date);
00503 QString listViewDate(const QString& caption);
00504 void setListViewSize(const QString& caption,const QString& size);
00505 void setListViewLabel(const QString& caption,const QString& label);
00507
00508 void updateColNames(const QString& oldName, const QString& newName);
00509 void updateTableNames(const QString& oldName, const QString& newName);
00510 void changeMatrixName(const QString& oldName, const QString& newName);
00511 void updateCurves(Table *t, const QString& name);
00512
00513 void showTable(const QString& curve);
00514 void showTable(int i);
00515
00516 void addColToTable();
00517 void cutSelection();
00518 void copySelection();
00519 void copyMarker();
00520 void pasteSelection();
00521 void clearSelection();
00522 void copyActiveLayer();
00523
00524 void newProject();
00525
00527 MultiLayer* newGraph(const QString& caption = tr("Graph"));
00528
00530
00531 Matrix* openMatrix(ApplicationWindow* app, const QStringList &flist);
00532 Table* openTable(ApplicationWindow* app, const QStringList &flist);
00533 TableStatistics* openTableStatistics(const QStringList &flist);
00534 Graph3D* openSurfacePlot(ApplicationWindow* app, const QStringList &lst);
00535 Graph* openGraph(ApplicationWindow* app, MultiLayer *plot, const QStringList &list);
00536
00537 void openRecentProject(int index);
00539
00541
00542 void sortSelection();
00543 void sortActiveTable();
00544 void normalizeSelection();
00545 void normalizeActiveTable();
00546 void correlate();
00547 void autoCorrelate();
00548 void convolute();
00549 void deconvolute();
00550 void clearTable();
00551 void goToRow();
00553
00555
00556 void newLegend();
00557 void addTimeStamp();
00558 void drawLine();
00559 void drawArrow();
00560 void drawPoints();
00561 void addText();
00562 void disableAddText();
00563 void addImage();
00564 void zoomIn();
00565 void zoomOut();
00566 void setAutoScale();
00567 void showRangeSelectors();
00568 void showCursor();
00569 void showScreenReader();
00570 void pickPointerCursor();
00571 void disableTools();
00572 void pickDataTool( QAction* action );
00573
00574 void updateLog(const QString& result);
00576
00578
00579 void deleteFitTables();
00580 void fitLinear();
00581 void fitSigmoidal();
00582 void fitGauss();
00583 void fitLorentz();
00584 void fitMultiPeak(int profile);
00585 void fitMultiPeakGauss();
00586 void fitMultiPeakLorentz();
00588
00590
00591 void differentiate();
00592 void analysis(const QString& whichFit);
00593 void analyzeCurve(Graph *g, const QString& whichFit, const QString& curveTitle);
00594 void showDataSetDialog(const QString& whichFit);
00596
00597 void addErrorBars();
00598 void defineErrorBars(const QString& name,int type,const QString& percent,int direction);
00599 void defineErrorBars(const QString& curveName,const QString& errColumnName, int direction);
00600 void movePoints();
00601 void removePoints();
00602
00604
00605 void closeEvent( QCloseEvent*);
00606 void timerEvent ( QTimerEvent *e);
00607 void dragEnterEvent( QDragEnterEvent* e );
00608 void dropEvent( QDropEvent* e );
00609 void customEvent( QEvent* e);
00611
00613
00614 void showFindDialogue();
00616 void showPlotDialog(int curveKey = -1);
00617 QDialog* showScaleDialog();
00618 QDialog* showPlot3dDialog();
00619 AxesDialog* showScalePageFromAxisDialog(int axisPos);
00620 AxesDialog* showAxisPageFromAxisDialog(int axisPos);
00621 void showAxisDialog();
00622 void showGridDialog();
00623 void showGeneralPlotDialog();
00624 void showResults(bool ok);
00625 void showResults(const QString& s, bool ok=true);
00626 void showTextDialog();
00627 void showLineDialog();
00628 void showTitleDialog();
00629 void showExportASCIIDialog();
00630 void showCurvesDialog();
00631 void showCurveRangeDialog();
00632 CurveRangeDialog* showCurveRangeDialog(Graph *g, int curve);
00633 void showPlotAssociations(int curve);
00634
00635 void showXAxisTitleDialog();
00636 void showYAxisTitleDialog();
00637 void showRightAxisTitleDialog();
00638 void showTopAxisTitleDialog();
00639 void showColumnOptionsDialog();
00640 void showRowsDialog();
00641 void showDeleteRowsDialog();
00642 void showColsDialog();
00643 void showColMenu(int c);
00644 void showColumnValuesDialog();
00645
00646 void showGraphContextMenu();
00647 void showTableContextMenu(bool selection);
00648 void showWindowContextMenu();
00649 void showWindowTitleBarMenu();
00650 void showCurveContextMenu(int curveKey);
00651 void showCurvePlotDialog();
00652 void showCurveWorksheet();
00653 void showCurveWorksheet(Graph *g, int curveIndex);
00654 void showWindowPopupMenu(Q3ListViewItem *it, const QPoint &p, int);
00655
00657 void showListViewSelectionMenu(const QPoint &p);
00658
00660 void showListViewPopupMenu(const QPoint &p);
00661
00662 void showScriptWindow();
00663 void showMoreWindows();
00664 void showMarkerPopupMenu();
00665 void showHelp();
00666 static void showStandAloneHelp();
00667 void chooseHelpFolder();
00668 void showPlotWizard();
00669 void showFitPolynomDialog();
00670 void showIntegrationDialog();
00671 void showInterpolationDialog();
00672 void showExpGrowthDialog();
00673 void showExpDecayDialog();
00674 void showExpDecayDialog(int type);
00675 void showTwoExpDecayDialog();
00676 void showExpDecay3Dialog();
00677 void showRowStatistics();
00678 void showColStatistics();
00679 void showFitDialog();
00680 void showImageDialog();
00681 void showLayerDialog();
00682 void showPreferencesDialog();
00683 void showMatrixDialog();
00684 void showMatrixSizeDialog();
00685 void showMatrixValuesDialog();
00686 void showSmoothSavGolDialog();
00687 void showSmoothFFTDialog();
00688 void showSmoothAverageDialog();
00689 void showSmoothDialog(int m);
00690 void showFilterDialog(int filter);
00691 void lowPassFilterDialog();
00692 void highPassFilterDialog();
00693 void bandPassFilterDialog();
00694 void bandBlockFilterDialog();
00695 void showFFTDialog();
00696 void showColorMapDialog();
00698
00699 void translateCurveHor();
00700 void translateCurveVert();
00701
00703 void removeCurve();
00704 void hideCurve();
00705 void hideOtherCurves();
00706 void showAllCurves();
00707 void setCurveFullRange();
00708
00709 void setAscValues();
00710 void setRandomValues();
00711 void setXCol();
00712 void setYCol();
00713 void setZCol();
00714 void setXErrCol();
00715 void setYErrCol();
00716 void setLabelCol();
00717 void disregardCol();
00718 void setReadOnlyCol();
00719 void setReadOnlyColumns();
00720 void setReadWriteColumns();
00721 void swapColumns();
00722 void moveColumnRight();
00723 void moveColumnLeft();
00724 void moveColumnFirst();
00725 void moveColumnLast();
00726
00727 void updateConfirmOptions(bool askTables, bool askMatrixes, bool askPlots2D, bool askPlots3D, bool askNotes);
00728
00730
00731 void toggle3DAnimation(bool on = true);
00733 void togglePerspective(bool on = true);
00735 void resetRotation();
00737 void fitFrameToLayer();
00738 void setFramed3DPlot();
00739 void setBoxed3DPlot();
00740 void removeAxes3DPlot();
00741 void removeGrid3DPlot();
00742 void setHiddenLineGrid3DPlot();
00743 void setLineGrid3DPlot();
00744 void setPoints3DPlot();
00745 void setCrosses3DPlot();
00746 void setCones3DPlot();
00747 void setBars3DPlot();
00748 void setFilledMesh3DPlot();
00749 void setEmptyFloor3DPlot();
00750 void setFloorData3DPlot();
00751 void setFloorIso3DPlot();
00752 void setFloorGrid3DPlot(bool on);
00753 void setCeilGrid3DPlot(bool on);
00754 void setRightGrid3DPlot(bool on);
00755 void setLeftGrid3DPlot(bool on);
00756 void setFrontGrid3DPlot(bool on);
00757 void setBackGrid3DPlot(bool on);
00758 void pickPlotStyle( QAction* action );
00759 void pickCoordSystem( QAction* action);
00760 void pickFloorStyle( QAction* action);
00761 void custom3DActions(QWidget *w);
00762 void custom3DGrids(int grids);
00764
00765 void updateRecentProjectsList();
00766
00768 void receivedVersionFile(bool error);
00770 void searchForUpdates();
00771
00772 void showDonationDialog();
00774 void showSupportPage();
00776 void showDonationsPage();
00778 void showHomePage();
00780 void showForums();
00782 void showBugTracker();
00784 void downloadManual();
00786 void downloadTranslation();
00787 #ifdef QTIPLOT_DEMO
00789 void showDemoVersionMessage();
00790 #endif
00791
00792 void parseCommandLineArguments(const QStringList& args);
00793 void createLanguagesList();
00794 void switchToLanguage(int param);
00795 void switchToLanguage(const QString& locale);
00796
00797 bool alreadyUsedName(const QString& label);
00798 bool projectHas2DPlots();
00799
00801 QWidget* window(const QString& name);
00802
00804 QStringList matrixNames();
00805
00807
00808
00809 Note* newNote(const QString& caption = QString());
00810 Note* openNote(ApplicationWindow* app, const QStringList &flist);
00811 void initNote(Note* m, const QString& caption);
00812 void saveNoteAs();
00814
00816
00817
00818 Folder* currentFolder(){return current_folder;};
00820 void addFolder();
00821 Folder* addFolder(QString name, Folder* parent = NULL);
00823 void deleteFolder();
00824
00826 bool deleteFolder(Folder *f);
00827
00829 void deleteSelectedItems();
00831 void hideSelectedWindows();
00833 void showSelectedWindows();
00834
00836 void desactivateFolders();
00837
00839 bool changeFolder(Folder *newFolder, bool force = false);
00840
00842 void folderItemChanged(Q3ListViewItem *it);
00844 void folderItemDoubleClicked(Q3ListViewItem *it);
00845
00847
00853 void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, bool fromFolders);
00854
00856 void showFolderPopupMenu(Q3ListViewItem *it, const QPoint &p, int);
00857
00859 void startRenameFolder();
00860
00862 void startRenameFolder(Q3ListViewItem *item);
00863
00865 void renameFolder(Q3ListViewItem *it, int col, const QString &text);
00866
00868 void showAllFolderWindows();
00869
00871 void hideAllFolderWindows();
00872
00874 void hideFolderWindows(Folder *f);
00875
00877 void folderProperties();
00878
00880 void windowProperties();
00881
00883 void projectProperties();
00884
00886 void appendProject();
00888 Folder* appendProject(const QString& file_name, Folder* parentFolder = 0);
00889 void saveAsProject();
00890 void saveFolderAsProject(Folder *f);
00891 void saveFolder(Folder *folder, const QString& fn, bool compress = false);
00892
00894 void addFolderListViewItem(Folder *f);
00895
00897 void addListViewItem(MyWidget *w);
00898
00900 void setShowWindowsPolicy(int p);
00901
00903 Folder* projectFolder();
00904
00906 void find(const QString& s, bool windowNames, bool labels, bool folderNames,
00907 bool caseSensitive, bool partialMatch, bool subfolders);
00908
00910 void dragFolderItems(QList<Q3ListViewItem *> items){draggedItems = items;};
00911
00913 void dropFolderItems(Q3ListViewItem *dest);
00914
00916
00920 void moveFolder(FolderListItem *src, FolderListItem *dest);
00921
00922 void foldersMenuActivated( int id );
00924
00926
00927
00928 void scriptError(const QString &message, const QString &scriptName, int lineNumber);
00930 void executeNotes();
00932 void showScriptingLangDialog();
00934 void restartScriptingEnv();
00936 void scriptPrint(const QString &text);
00938 bool setScriptingLanguage(const QString &lang, bool force=false);
00939
00940 void scriptsDirPathChanged(const QString& path);
00942
00943 void showToolBarsMenu();
00944
00945 signals:
00946 void modified();
00947
00948 private:
00949 virtual QMenu * createPopupMenu(){return NULL;};
00950
00951 private slots:
00953
00954 void insertTranslatedStrings();
00955 void translateActionsStrings();
00956 void init(bool factorySettings = false);
00957 void initGlobalConstants();
00958 void createActions();
00959 void initMainMenu();
00960 void initToolBars();
00961 void initPlot3DToolBar();
00962 void disableActions();
00963 void customColumnActions();
00964 void disableToolbars();
00965 void customToolBars(QWidget* w);
00966 void customMenu(QWidget* w);
00967 void windowActivated(QWidget *w);
00969
00970 void analysisMenuAboutToShow();
00971 void fileMenuAboutToShow();
00972 void matrixMenuAboutToShow();
00973 void plotMenuAboutToShow();
00974 void plotDataMenuAboutToShow();
00975 void tableMenuAboutToShow();
00976 void windowsMenuAboutToShow();
00977 void windowsMenuActivated( int id );
00978
00980
00981 void enableTextEditor(Graph *g);
00982 void setFormatBarFont(const QFont &);
00983 void setFontSize(int);
00984 void setFontFamily(const QFont &);
00985 void setItalicFont(bool);
00986 void setBoldFont(bool);
00987 void insertSuperscript();
00988 void insertSubscript();
00989 void underline();
00990 void insertGreekSymbol();
00992
00993 void showCustomActionDialog();
00994 void performCustomAction(QAction *);
00995
00996
00997 public:
00998 QString customActionsDirPath;
00999 bool d_matrix_tool_bar, d_file_tool_bar, d_table_tool_bar, d_column_tool_bar, d_edit_tool_bar;
01000 bool d_plot_tool_bar, d_plot3D_tool_bar, d_display_tool_bar, d_format_tool_bar;
01001 bool d_backup_files;
01002 WindowType d_init_window_type;
01003 QRect d_script_win_rect, d_app_rect;
01004 bool d_script_win_on_top;
01005 bool d_inform_rename_table;
01006 QString d_export_col_separator;
01007 bool d_export_col_names, d_export_table_selection, d_export_col_comment;
01008
01009 bool d_thousands_sep;
01011 QString d_image_export_filter;
01012 bool d_keep_plot_aspect;
01013 int d_export_vector_size;
01014 bool d_export_transparency;
01015 int d_export_quality;
01016 int d_export_resolution;
01017 bool d_export_color;
01019 QLocale d_ASCII_import_locale;
01021 QString d_ASCII_file_filter, d_ASCII_comment_string;
01022 bool d_import_dec_separators, d_ASCII_import_comments, d_ASCII_import_read_only, d_ASCII_import_preview;
01023 int d_ASCII_import_mode, d_preview_lines;
01025 bool d_show_current_folder;
01026 bool d_scale_plots_on_print, d_print_cropmarks;
01027 bool d_show_table_comments;
01028 bool d_extended_plot_dialog;
01029 bool d_extended_import_ASCII_dialog;
01030 bool d_extended_export_dialog;
01031 bool d_extended_open_dialog;
01032 bool generateUniformFitPoints;
01033 bool generatePeakCurves;
01034 int peakCurvesColor;
01036 QSize d_add_curves_dialog_size;
01037
01039 bool fit_scale_errors;
01040
01042 int fitPoints;
01043
01045 bool d_2_linear_fit_points;
01046
01047 bool pasteFitResultsToPlot;
01048
01050 bool writeFitResultsToLog;
01051
01053 int fit_output_precision;
01054
01056 int d_decimal_digits;
01057
01059 Folder *current_folder;
01061 ShowWindowsPolicy show_windows_policy;
01062 enum {MaxRecentProjects = 10};
01064 int d_file_version;
01065
01066 QColor workspaceColor, panelsColor, panelsTextColor;
01067 QString appStyle, workingDir;
01068
01070 QString templatesDir;
01071 bool smooth3DMesh, autoScaleFonts, autoResizeLayers, askForSupport, autoSearchUpdates;
01072 bool confirmCloseTable, confirmCloseMatrix, confirmClosePlot2D, confirmClosePlot3D;
01073 bool confirmCloseFolder, confirmCloseNotes;
01074 bool titleOn, autoSave, drawBackbones, allAxesOn, autoscale2DPlots, antialiasing2DPlots;
01075 int majTicksStyle, minTicksStyle, legendFrameStyle, autoSaveTime, axesLineWidth, canvasFrameWidth;
01076 QColor legendBackground, legendTextColor, defaultArrowColor;
01077 int defaultArrowLineWidth, defaultArrowHeadLength, defaultArrowHeadAngle;
01078 bool defaultArrowHeadFill;
01079 Qt::PenStyle defaultArrowLineStyle;
01080 int majTicksLength, minTicksLength, defaultPlotMargin;
01081 int defaultCurveStyle, defaultCurveLineWidth, defaultSymbolSize;
01082 QFont appFont, plot3DTitleFont, plot3DNumbersFont, plot3DAxesFont;
01083 QFont tableTextFont, tableHeaderFont, plotAxesFont, plotLegendFont, plotNumbersFont, plotTitleFont;
01084 QColor tableBkgdColor, tableTextColor, tableHeaderColor;
01085 QString projectname,columnSeparator, helpFilePath, appLanguage;
01086 QString configFilePath, fitPluginsPath, fitModelsPath, asciiDirPath, imagesDirPath, scriptsDirPath;
01087 int ignoredLines, savingTimerId, plot3DResolution, recentMenuID;
01088 bool renameColumns, strip_spaces, simplify_spaces;
01089 QStringList recentProjects, tableWindows;
01090 bool saved, showPlot3DProjection, showPlot3DLegend, orthogonal3DPlots, autoscale3DPlots;
01091 QStringList plot3DColors, locales;
01092 QStringList functions;
01093 QStringList xFunctions, yFunctions, rFunctions, thetaFunctions;
01094 QStringList surfaceFunc;
01095 QStringList d_param_surface_func;
01097 QStringList renamedTables;
01098
01100
01101 LegendWidget *d_text_copy;
01102 ArrowMarker *d_arrow_copy;
01103 ImageMarker *d_image_copy;
01105
01107 bool autoSearchUpdatesRequest;
01108
01110 QString defaultScriptingLang;
01111
01112 private:
01113 TextEditor *d_text_editor;
01114 QLocale d_locale;
01115
01116 #ifdef QTIPLOT_DEMO
01117 int demoCloseTimerId;
01118 #endif
01119
01121 int convertOldToNewColorIndex(int cindex);
01122
01124 QList<Q3ListViewItem *> draggedItems;
01125
01127 QHttp http;
01129 QBuffer version_buffer;
01130
01131 Graph *lastCopiedLayer;
01132 QSplitter *explorerSplitter;
01133
01134 QAssistantClient *assistant;
01135 ScriptWindow *scriptWindow;
01136 QTranslator *appTranslator, *qtTranslator;
01137 QDockWidget *explorerWindow;
01138 QTextEdit *results;
01139 #ifdef SCRIPTING_CONSOLE
01140 QDockWidget *consoleWindow;
01141 QTextEdit *console;
01142 #endif
01143 QWorkspace *ws;
01144 QToolBar *fileTools, *plotTools, *tableTools, *columnTools, *plot3DTools, *displayBar, *editTools, *plotMatrixBar;
01145 QToolBar *formatToolBar;
01146 QToolButton *btnResults;
01147 QWidgetList *hiddenWindows, *outWindows;
01148 QLineEdit *info;
01149 QWidget *lastModified;
01150
01151 QMenu *windowsMenu, *foldersMenu, *view, *graph, *fileMenu, *format, *edit, *recent;
01152 QMenu *help, *plot2DMenu, *analysisMenu, *multiPeakMenu;
01153 QMenu *matrixMenu, *plot3DMenu, *plotDataMenu, *tablesDepend, *scriptingMenu;
01154 QMenu *tableMenu, *fillMenu, *normMenu, *newMenu, *exportPlotMenu, *smoothMenu, *filterMenu, *decayMenu;
01155
01156 QAction *actionEditCurveRange, *actionCurveFullRange, *actionShowAllCurves, *actionHideCurve, *actionHideOtherCurves;
01157 QAction *actionEditFunction, *actionRemoveCurve, *actionShowCurveWorksheet, *actionShowCurvePlotDialog;
01158 QAction *actionNewProject, *actionNewNote, *actionNewTable, *actionNewFunctionPlot;
01159 QAction *actionNewSurfacePlot, *actionNewMatrix, *actionNewGraph, *actionNewFolder;
01160 QAction *actionOpen, *actionLoadImage, *actionSaveProject, *actionSaveProjectAs, *actionImportImage;
01161 QAction *actionLoad, *actionUndo, *actionRedo;
01162 QAction *actionCopyWindow;
01163 QAction *actionCutSelection, *actionCopySelection, *actionPasteSelection, *actionClearSelection;
01164 QAction *actionShowExplorer, *actionShowLog, *actionAddLayer, *actionShowLayerDialog, *actionAutomaticLayout;
01165 #ifdef SCRIPTING_CONSOLE
01166 QAction *actionShowConsole;
01167 #endif
01168 QAction *actionSwapColumns, *actionMoveColRight, *actionMoveColLeft, *actionMoveColFirst, *actionMoveColLast;
01169 QAction *actionExportGraph, *actionExportAllGraphs, *actionPrint, *actionPrintAllPlots, *actionShowExportASCIIDialog;
01170 QAction *actionExportPDF, *actionReadOnlyCol;
01171 QAction *actionCloseAllWindows, *actionClearLogInfo, *actionShowPlotWizard, *actionShowConfigureDialog;
01172 QAction *actionShowCurvesDialog, *actionAddErrorBars, *actionAddFunctionCurve, *actionUnzoom, *actionNewLegend, *actionAddImage, *actionAddText;
01173 QAction *actionPlotL, *actionPlotP, *actionPlotLP, *actionPlotVerticalDropLines, *actionPlotSpline;
01174 QAction *actionPlotVertSteps, *actionPlotHorSteps, *actionPlotVerticalBars;
01175 QAction *actionPlotHorizontalBars, *actionPlotArea, *actionPlotPie, *actionPlotVectXYAM, *actionPlotVectXYXY;
01176 QAction *actionPlotHistogram, *actionPlotStackedHistograms, *actionPlot2VerticalLayers, *actionPlot2HorizontalLayers, *actionPlot4Layers, *actionPlotStackedLayers;
01177 QAction *actionPlot3DRibbon, *actionPlot3DBars, *actionPlot3DScatter, *actionPlot3DTrajectory;
01178 QAction *actionShowColStatistics, *actionShowRowStatistics, *actionShowIntDialog;
01179 QAction *actionDifferentiate, *actionFitLinear, *actionShowFitPolynomDialog;
01180 QAction *actionShowExpDecayDialog, *actionShowTwoExpDecayDialog, *actionShowExpDecay3Dialog;
01181 QAction *actionFitExpGrowth, *actionFitSigmoidal, *actionFitGauss, *actionFitLorentz, *actionShowFitDialog;
01182 QAction *actionShowAxisDialog, *actionShowTitleDialog;
01183 QAction *actionShowColumnOptionsDialog, *actionShowColumnValuesDialog, *actionShowColsDialog, *actionShowRowsDialog;
01184 QAction *actionTableRecalculate;
01185 QAction *actionAbout, *actionShowHelp, *actionChooseHelpFolder;
01186 QAction *actionRename, *actionCloseWindow, *actionConvertTable;
01187 QAction *actionAddColToTable, *actionDeleteLayer, *actionInterpolate;
01188 QAction *actionResizeActiveWindow, *actionHideActiveWindow;
01189 QAction *actionShowMoreWindows, *actionPixelLineProfile, *actionIntensityTable;
01190 QAction *actionShowLineDialog, *actionShowImageDialog, *actionShowTextDialog;
01191 QAction *actionActivateWindow, *actionMinimizeWindow, *actionMaximizeWindow, *actionHideWindow, *actionResizeWindow, *actionPrintWindow;
01192 QAction *actionEditSurfacePlot, *actionAdd3DData;
01193 QAction *actionMatrixDeterminant, *actionSetMatrixProperties;
01194 QAction *actionSetMatrixDimensions, *actionConvertMatrix, *actionSetMatrixValues, *actionTransposeMatrix, *actionInvertMatrix;
01195 QAction *actionPlot3DWireFrame, *actionPlot3DHiddenLine, *actionPlot3DPolygons, *actionPlot3DWireSurface;
01196 QAction *actionColorMap, *actionContourMap, *actionGrayMap;
01197 QAction *actionDeleteFitTables, *actionShowGridDialog, *actionTimeStamp;
01198 QAction *actionSmoothSavGol, *actionSmoothFFT, *actionSmoothAverage, *actionFFT;
01199 QAction *actionLowPassFilter, *actionHighPassFilter, *actionBandPassFilter, *actionBandBlockFilter;
01200 QAction *actionSortTable, *actionSortSelection, *actionNormalizeSelection;
01201 QAction *actionNormalizeTable, *actionConvolute, *actionDeconvolute, *actionCorrelate, *actionAutoCorrelate;
01202 QAction *actionTranslateHor, *actionTranslateVert, *actionSetAscValues, *actionSetRandomValues;
01203 QAction *actionSetXCol, *actionSetYCol, *actionSetZCol, *actionSetLabelCol, *actionDisregardCol, *actionSetXErrCol, *actionSetYErrCol;
01204 QAction *actionBoxPlot, *actionMultiPeakGauss, *actionMultiPeakLorentz, *actionCheckUpdates;
01205 QAction *actionDonate, *actionHomePage, *actionDownloadManual, *actionTechnicalSupport, *actionTranslations;
01206 QAction *actionHelpForums, *actionHelpBugReports;
01207 QAction *actionShowPlotDialog, *actionShowScaleDialog, *actionOpenTemplate, *actionSaveTemplate;
01208 QAction *actionNextWindow, *actionPrevWindow;
01209 QAction *actionScriptingLang, *actionRestartScripting, *actionClearTable, *actionGoToRow;
01210 QAction *actionNoteExecute, *actionNoteExecuteAll, *actionNoteEvaluate, *actionSaveNote;
01211 QAction *actionShowScriptWindow;
01212 QAction *actionAnimate, *actionPerspective, *actionFitFrame, *actionResetRotation;
01213 QAction *actionDeleteRows, *actionDrawPoints;
01214 QActionGroup* dataTools;
01215 QAction *btnCursor, *btnSelect, *btnPicker, *btnRemovePoints, *btnMovePoints;
01216 QAction *btnZoomIn, *btnZoomOut, *btnPointer, *btnLine, *btnArrow;
01217 QAction *actionFlipMatrixVertically, *actionFlipMatrixHorizontally, *actionRotateMatrix;
01218 QAction *actionViewMatrixImage, *actionViewMatrix, *actionExportMatrix;
01219 QAction *actionMatrixGrayScale, *actionMatrixRainbowScale, *actionMatrixCustomScale, *actionRotateMatrixMinus;
01220 QAction *actionMatrixXY, *actionMatrixColumnRow, *actionImagePlot, *actionToolBars;
01221 QAction *actionMatrixFFTDirect, *actionMatrixFFTInverse;
01222 QAction *actionFontBold, *actionFontItalic, *actionFontBox, *actionFontSize;
01223 QAction *actionSuperscript, *actionSubscript, *actionUnderline, *actionGreekSymbol, *actionCustomActionDialog;
01224
01225 QActionGroup* coord;
01226 QAction* Box;
01227 QAction* Frame;
01228 QAction* None;
01229
01230 QActionGroup* grids;
01231 QAction* front;
01232 QAction* back;
01233 QAction* right;
01234 QAction* left;
01235 QAction* ceil;
01236 QAction* floor;
01237
01238 QActionGroup* floorstyle;
01239 QAction* floordata;
01240 QAction* flooriso;
01241 QAction* floornone;
01242
01243 QActionGroup* plotstyle;
01244 QAction* wireframe;
01245 QAction* hiddenline;
01246 QAction* polygon;
01247 QAction* filledmesh;
01248 QAction* pointstyle;
01249 QAction* barstyle;
01250 QAction *conestyle, *crossHairStyle;
01251 QList<QAction *> d_user_actions;
01252 };
01253 #endif